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

Notification

Icon
Error

RDI not playing well when debugging MSpec specifications
Tim Long
#1 Posted : Monday, March 11, 2024 11:02:32 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 24
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
I have an issue where I am trying to debug some code. I go to the code and right-click one of the coverage dots (its red) and select "Break into this covering test at this line". (Aside: I think NCrunch is getting this wrong for MSpec tests - this is not a covering test, it is covered code, but that's tangential).

OK this works, I hit my breakpoint. So I've broken in the debugger in a running test. Then I hit "Step into" to step into the method that's being called, but instead of entering my method, I end up at
Code:
public unsafe bool CheckForNewSession()
.

This obviously isn't my code, it's in RdiSessionIdReference.cs which is part of NCrunch. This appears to happen any time I try to step into a method while debugging a running test.

This is a bit of a showstopper. I love RDI but I can't have it getting in the way of my debugging. I've only just enabled it on this computer today and noticed this problem almost immediately.

I'm using MSpec as my testing/BDD framework, if that makes any difference.
Remco
#2 Posted : Monday, March 11, 2024 9:01:07 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for sharing this issue.

As you've described, this is caused by the debugger stepping into NCrunch's instrumentation. For the time being, the fix for this is to turn on the 'Just My Code' VS debugging setting when running the debugger over code instrumented by RDI. This will prevent any accidental stepping into RDI's code.

The longer term fix for this is for us to mark RDI extensively with attributes to prevent the debugger from stepping into it. Unfortunately, the attributes we need for this don't exist prior to netstandard2.0, which means we either need to withdraw support for netcoreapp1.1, or we need to further cross-compile our runtime libraries for more fragmented support .. it will take us a while to sort this out. 'Just My Code' will get you working for now.
1 user thanked Remco for this useful post.
Tim Long on 3/12/2024(UTC)
Tim Long
#3 Posted : Tuesday, March 12, 2024 8:04:40 AM(UTC)
Rank: Member

Groups: Registered
Joined: 8/20/2016(UTC)
Posts: 24
Location: United Kingdom

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
If its as simple as turning on "just my code" then as far as I'm concerned that's a fix. It never occurred to me that might be turned off (I checked, and it was).
1 user thanked Tim Long for this useful post.
Remco on 3/12/2024(UTC)
Users browsing this topic
Guest
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.669 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download