Hi,
Unfortunately, I cannot create a self-contained sample solution because I cannot reproduce the error in a sample solution.
I'll try to describe my problem. I have a test and i create a new record object "var test = new MyRecord {Name =" test ", Length = 4}" in this test and NCrunch throws this exception:
Quote:System.InvalidProgramException: Common Language Runtime detected an invalid program.
at MyRecord.set_Length (Int64 value)
at TestClass () in: line 367
at Xunit.Sdk.TestInvoker`1. <> c__DisplayClass48_1. <<InvokeTestMethodAsync> b__1> d.MoveNext () in C: \ Dev \ xunit \ xunit \ src \ xunit.execution \ Sdk \ Frameworks \ Runners \ TestInvoker.cs: line 264
--- End of stack trace from previous location ---
at Xunit.Sdk.ExecutionTimer.AggregateAsync (Func`1 asyncAction) in C: \ Dev \ xunit \ xunit \ src \ xunit.execution \ Sdk \ Frameworks \ ExecutionTimer.cs: line 48
at Xunit.Sdk.ExceptionAggregator.RunAsync (Func`1 code) in C: \ Dev \ xunit \ xunit \ src \ xunit.core \ Sdk \ ExceptionAggregator.cs: line 90
I tried to find the error and i found another "record" in my code with a DateTime property and when I changed the property from {get; init;} to {get; set;} - the test passed.
But this record was not covered by my test and I could not reproduce this case in the sample solution.
I suspect that the error message is incorrect or incomplete.
It's a pretty strange problem and I hope this description may help you.