-
Notifications
You must be signed in to change notification settings - Fork 152
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
Could not load file or assembly 'System.Management.Automation' after update to .NET 7 (3.16.x) #1310
Comments
Regarding the Regarding the original issue, then I guess it is due to conflicting engine versions (the console comes with one version and the NUnit3TestAdapter comes with another). If you remove the reference to |
Thank you for your answer. Unfortunately removing reference to |
@mikkelbu Removing reference to |
@KJoreth I'm sorry that I missed your comment, but I've no idea of why it does not work |
I'm getting similar issues with .NET 7.
I have tried modifying [Edit: added below but then discovered it is actually because I dropped the reference to Microsoft.NET.Test.Sdk thinking it was not needed]
|
@accentsoftware-simonl @KJoreth I think this might be related to #1324. In your bin folder, do you have a file there named Microsoft.Extensions.DependencyModel ? Check the version properties of that file, and if it says 3.1 then that is probably the issue. From #1324 you can see the issues we noted on the TestAdapter, and we had to revert back to 3.15.2. @accentsoftware-simonl I see you also use Also, note that running with NUnit.Engine version 3.16.X and any version of the adapter (which you need for dotnet test) is incompatible. |
Thanks @OsirisTerje. I am trying to switch from dotnet test to nunit console because I have older .Net 4.6.2 tests running in parallel (via MSBuild parallelism) that I want to run in parallel with these tests on our build server. [BTW, part of why I am doing that is that there doesn't seem to be a way with nunit's 2 parallelism mechanisms to group sets of classes (across multiple assemblies) which can run in parallel with other groups of classes but not within themselves.] dotnet test works with adapter 4.4.2 and also NUnit.Console 3.16.3 package referenced. Downgrading console to 3.15.2 gives similar but different assembly issues |
@accentsoftware-simonl Can you provide a repro for the latest here? I don't see any reason for adapter 4.4.2 not to be able to load assemblies, given that there are no NUnit.Console or NUnit.Engine version 3.16.X present. If you're going to be using NUnit.Console 3.16.X you need to - during build - remove what comes from the adapter package - for that test scenario. PS: |
@OsirisTerje I have some higher priorities at the moment but should be able to get back to this in the next few weeks. I do notice one test assembly out of 3 works fine so it may have something to do with indirect dependencies - I think there are a few .NET Standard assemblies referenced - I remember seeing something about .NET Standard not being supported so would that be it? |
@accentsoftware-simonl Net Standard should work fine as SUT. |
This looks fixed in 3.16.3 release |
I confirm. It's fixed. |
@OsirisTerje @MichalMucek |
@accentsoftware-simonl Sorry if I closed it too soon, feel free to reopen this if you still see the issue. To all: We still don't have any repro for this, so if multiple people have this issue, it should be possible for one of you to provide a small repro. We DO need that in order to work out a fix :-) |
After updating our project to .NET 7, NUnitConsole won't run any of our tests via Windows PowerShell.
After running
.\nunit3-console.exe("tests.dll")
we get an error:Even though running the same tests with
dotnet test
runs just fine.We have tried to run it with NUnitConsole 3.16.0 / 3.16.1 and 3.16.2
Scripts are run on PowerShell 5.1.19041.1237 and Windows 10 (build 19043.1288). We did try to use the newest version of PS as well but without any success.
Nuggets in out project which may have some influence:
Log file you can find here:
InternalTrace.6200.log
Running the script with --inprocess flag returns:
On NUnitConsole 3.15.2 and .NET 6 everything works. NUnitConsole was installed via zip file.
The text was updated successfully, but these errors were encountered: