Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

System.InvalidProgramException: Common Language Runtime detected an invalid program.
htssoftwares
#1 Posted : Wednesday, November 25, 2020 2:17:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 6
Location: France

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hello,

When using NCrunch on a .NET 5 project, that uses C# 9 records, NCrunch returns the following error for each tests :

System.InvalidProgramException: Common Language Runtime detected an invalid program.

The code that throws :

state with { Loading = true };
Where state is a record

This exception doesn't happens with standard test explorer.

Any way to avoir this ?

Thanks
Remco
#2 Posted : Wednesday, November 25, 2020 11:24:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
htssoftwares
#3 Posted : Thursday, November 26, 2020 6:49:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 6
Location: France

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hello Remco,

Thank you for your answer.
I downloaded and installed the build 4.6.0.2, however, I still have this issue.

For now, I'll disable NCrunch on this project and turn on Live Unit Testing, as it works with this.
But I'll be happy to re-enable NCrunch when this will be fixed !
Remco
#4 Posted : Thursday, November 26, 2020 7:26:19 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
htssoftwares;15116 wrote:

Thank you for your answer.
I downloaded and installed the build 4.6.0.2, however, I still have this issue.


Thanks for coming back to me on this. Your feedback here sets off alarm bells for me, as I was so sure that we had fixed this problem in the build above.

Can you check that you have v4.6.0.2 showing in the 'About' page for NCrunch? If so, is there any chance you can build a sample solution demonstrating the problem that you might be able to share with me? You can submit code in ZIP form through the NCrunch support contact form.
htssoftwares
#5 Posted : Thursday, November 26, 2020 8:48:58 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 6
Location: France

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I have 4.6.0.2 on about page (BTW, copyright dates end in 2018).

I posted the sln that fails on my machine.
Remco
#6 Posted : Thursday, November 26, 2020 8:53:49 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for the fast response! I think I know what's happening here.

Can you set the 'Instrumentation Mode' solution-level setting to 'Optimised' to see if this solves the issue?
2 users thanked Remco for this useful post.
htssoftwares on 11/26/2020(UTC), DeltaEngine on 11/30/2020(UTC)
htssoftwares
#7 Posted : Thursday, November 26, 2020 9:48:31 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 6
Location: France

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
It works perfectly ! Thank you :-)
Remco
#8 Posted : Thursday, November 26, 2020 9:51:21 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
htssoftwares;15120 wrote:
It works perfectly ! Thank you :-)


Excellent! Thanks :)
DeltaEngine
#10 Posted : Monday, November 30, 2020 12:21:02 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/23/2012(UTC)
Posts: 31
Location: Germany

Thanks: 8 times
Was thanked: 3 time(s) in 3 post(s)
Helped us as well, thanks for the fix :)
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.054 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download