Skip to content

junit doesn't work when running tests with n472 #167

@appel1

Description

@appel1

Describe the bug
A clear and concise description of what the bug is.

  • NUnit
  • net472;net8.0
  • dotnet test --no-build --logger:"junit" --results-directory artifacts/test-reports
  • Windows

Using NUnit for a test project targeting both net472 and net8.0.

    <PackageReference Include="NUnit" Version="4.3.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="5.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="JunitXml.TestLogger" Version="6.0.0" />
Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'junit'.
  Example.Tests test net472 failed with 1 error(s) (0,2s)
    C:\Program Files\dotnet\sdk\9.0.200\Microsoft.TestPlatform.targets(48,5): error MSB6006: "dotnet.exe" exited with code 1.
NUnit Adapter 5.0.0.0: Test execution started
Running all tests in E:\dev\Example\artifacts\bin\Example.Tests\debug_net8.0\Example.Tests.dll
   NUnit3TestExecutor discovered 72 of 72 NUnit test cases using Current Discovery mode, Non-Explicit run
NUnit Adapter 5.0.0.0: Test execution complete
Results File: E:\dev\Example\artifacts\test-reports\TestResults.xml
  Example.Tests test net8.0 succeeded (3,4s)

Test summary: total: 72; failed: 0; succeeded: 72; skipped: 0; duration: 3,4s
Build failed with 1 error(s) in 3,8s

Expected behavior
Success for both net472 and net8.0 targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions