Build/Test Issues

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

Started by jageall on 10 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.

Post a reply

Log in to reply.