Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 6 tests require NUnit.Console 3.15.0 or later #3790

Closed
yfdyh000 opened this issue Mar 23, 2022 · 2 comments
Closed

.NET 6 tests require NUnit.Console 3.15.0 or later #3790

yfdyh000 opened this issue Mar 23, 2022 · 2 comments

Comments

@yfdyh000
Copy link

See the nunit/nunit-console#1101, nunit/nunit-console#1123 fixed this issue.

Appveyor still supply the NUnit.Console 3.13.0 by default.
error:
NUnit Console Runner 3.13.0 (.NET 2.0)
----> Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

A workaround based the post:

      before_build:
        - ps: |
           # nunit
           $nunitPath = "$env:SYSTEMDRIVE\Tools\NUnit3"
           Remove-Item $nunitPath -Recurse -Force
           $zipPath = "$env:TEMP\NUnit.Console-3.15.0.zip"
           $tempPath = "$env:TEMP\NUnit.Console"
           (New-Object Net.WebClient).DownloadFile('https://github.com/nunit/nunit-console/releases/download/3.15.0/NUnit.Console-3.15.0.zip', $zipPath)
           7z x $zipPath -y -o"$tempPath" | Out-Null
           [IO.Directory]::Move("$tempPath\bin\net6.0", $nunitPath)
           # logger
           $zipPath = "$env:TEMP\Appveyor.NUnit3Logger.zip"
           (New-Object Net.WebClient).DownloadFile('https://www.appveyor.com/downloads/Appveyor.NUnit3Logger.zip', $zipPath)
           7z x $zipPath -y -o"$nunitPath\addins" | Out-Null
           Move-Item "$nunitPath\addins\appveyor.addins" "$nunitPath\appveyor.addins"

Then,

      test_script:
        - C:\Tools\NUnit3\nunit3-console "C:\path\name.dll" -result=myresults.xml

however, appends the ;format=AppVeyor will be thrown Unknown result format: AppVeyor for now.

@FeodorFitsner FeodorFitsner added this to the next-images-update milestone Mar 23, 2022
@FeodorFitsner
Copy link
Member

Will try it during the next image update.

Wondering why are you not using dotnet test ... to test .NET Core projects?

@yfdyh000
Copy link
Author

Wondering why are you not using dotnet test ... to test .NET Core projects?

Just try to fix the CI for the project, it originally worked. I'm not sure the difference between the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants