4.4.0 breaking change for TestAssemblyLoadContext
See original GitHub issueLooks like it may be specific to roslyn generated types:
System.InvalidCastException : [A]Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals cannot be cast to [B]Microsoft.CodeAnalysis.Scripting.Hosting.CommandLineScriptGlobals. Type A originates from 'Microsoft.CodeAnalysis.Scripting, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context '"" NUnit.Engine.Internal.TestAssemblyLoadContext #2' at location '/alloy-test/AlloyEngineTest/bin/x64/Debug/net7.0/Microsoft.CodeAnalysis.Scripting.dll'. Type B originates from 'Microsoft.CodeAnalysis.Scripting, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location '/alloy-test/AlloyEngineTest/bin/x64/Debug/net7.0/Microsoft.CodeAnalysis.Scripting.dll'.
When reporting a bug, please provide the following information to speed up triage:
- NUnit and NUnit3TestAdapter versions: 4.4.0 / 17.5.0
- Visual Studio edition and full version number (see Help About): Pro 17.4.4 (but error is on dotnet test command without VS installed)
- A short repro, preferably attached or pointing to a git repo or gist: Looks like an object passed to a
Scriptexecution that comes from the test load context, while the script was compiled in the Default context. - What .net platform and version is being targeted: 7
- If TFS/VSTS issue, what version, hosted or on-premises, and what build task you see this in: it’s
dotnet testrunning inside a docker container mcr.microsoft.com/dotnet/sdk:7.0
Issue Analytics
- State:
- Created 7 months ago
- Reactions:3
- Comments:32 (17 by maintainers)
Top Results From Across the Web
Azure PowerShell release notes
Added breaking change notification for cmdlets to be removed and parameters to be changed. Cmdlet 'New-AzSqlVMConfig' will be removed. Cmdlet ' ...
Read more >NET 7 breaking change: Collectible Assembly in non- ...
Type of breaking change. This change can affect binary compatibility. Reason for change. This change fixes a bug. The collectible Assembly would ...
Read more >https://raw.githubusercontent.com/dotnet/samples/m...
Change in behavior can break existing usage of Process.Star() - and it did even in trivial case for corefx tests. /bin/sh is pretty...
Read more >Release Notes
BREAKING: Hide globbing behind an interface to make stuff more testable. BREAKING: Change Environment Map behavior in Process to allow removal of environment ......
Read more >Progress® Telerik® JustMock Feedback Portal
A test exists where the formatter is used but when the JustMock profiler is enabled an ... R3.2021 breaking change: unable to mock...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@OsirisTerje should 4.4 be unlisted? it broke approx 50% of projects i used it on
Hotfix version 4.4.2, nearly identical to the alpha version attached yesterday, is now released. The difference from the attached version is that the Microsoft.Extensions.DependencyModel is not include in the adapter package. It is not needed there, so it was removed. The release notes is here https://docs.nunit.org/articles/vs-test-adapter/AdapterV4-Release-Notes.html (includes some more explanations) and the package is uploaded to nuget https://www.nuget.org/packages/NUnit3TestAdapter/4.4.2. Thanks, everyone for reporting and providing repros!