After some minor refactoring, a codebase began experiencing unexpected test failures via the ncrunch runner, that were not also failures when using other runners.
System.InvalidProgramException: Common Language Runtime detected an invalid program.
(With a call stack ending at an attempt to set an init property.)
After some investigation it appears to be related to use of System.Runtime.CompilerServices IsExternalInit which I introduced a while ago as part of a preview feature workaround. Ultimately I no longer required the workaround and was able to remove my defintiion of IsExternalInit to restore successful test execution via ncrunch.
Minimal repro here:
https://github.com/eric-winkler/ncruncherror
This may be the same issue as
https://forum.ncrunch.ne...rties-again---NET-5.aspx