With .net 11 and xunit v3 runtime-async=on (csproj feature property) and Instrument output assembly = true (ncrunch config) the instrumentation causes the following exception in any async code:
System.InvalidProgramException: Common Language Runtime detected an invalid program.
{location}
in the csproj:
<PropertyGroup>
<Features>runtime-async=on</Features>
</PropertyGroup>
I can work around it by conditionally setting the property (<Features Condition="'$(NCrunch)' != '1'">runtime-async=on</Features>) in the project file as having instrumentation on while i work is more desirable than avoiding having to manually run the tests after to make sure it works.
I am guessing this might take a bit of work to fix (and hopefully is fixable) but I could not find any mention of it in the forums so wanted to make sure it is raised in case it is not reported yet. Appreciate it is not even a week since .net 11 release.
Edited 12 Nov 2026 22:19 UTC