question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

4.4.0 breaking change for TestAssemblyLoadContext

See original GitHub issue

Looks 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 Script execution 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 test running inside a docker container mcr.microsoft.com/dotnet/sdk:7.0

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Reactions:3
  • Comments:32 (17 by maintainers)

github_iconTop GitHub Comments

5reactions
SimonCroppcommented, Mar 1, 2023

@OsirisTerje should 4.4 be unlisted? it broke approx 50% of projects i used it on

3reactions
OsirisTerjecommented, Mar 1, 2023

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found