Build/Test Issues

runtime-async=on with instrumentation results all async tests failing with invalid program exceptions

Started by jageall on 42 views

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

Hi, thanks for sharing this.

Yes, this looks like it's going to take some work for NCrunch to support. I'm looking into it now. Sorry, I can't promise a quick fix here. I recommend leaving this off for now under NCrunch.
No problem, figured it was going to be some work. I have my workaround so for me it is not urgent. Thanks for the speedy reply.
I've taken a stab at adding support for this. Do you want to give it a try? It's been implemented in the build below.

NCrunch_Console_5.25.0.3.msi
NCrunch_Console_5.25.0.3.zip
NCrunch_GridNodeServer_5.25.0.3.msi
NCrunch_GridNodeServer_5.25.0.3.zip
NCrunch_LicenseServer_5.25.0.3.zip
NCrunch_Rider_5.25.0.3.7z
NCrunch_Rider_5.25.0.3.zip
NCrunch_VS2017_5.25.0.3.msi
NCrunch_VS2017_5.25.0.3.msi.7z
NCrunch_VS2017_5.25.0.3.zip
NCrunch_VS2019_5.25.0.3.msi
NCrunch_VS2019_5.25.0.3.msi.7z
NCrunch_VS2019_5.25.0.3.zip
NCrunch_VS2022_5.25.0.3.msi
NCrunch_VS2022_5.25.0.3.msi.7z
NCrunch_VS2022_5.25.0.3.zip
NCrunch_VS2026_5.25.0.3.msi
NCrunch_VS2026_5.25.0.3.msi.7z
NCrunch_VS2026_5.25.0.3.zip

Post a reply

Log in to reply.