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

Notification

Icon
Error

error CS0103: the name '' does not exist in the current context
JamesGrafton
#1 Posted : Wednesday, May 11, 2016 9:01:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/17/2016(UTC)
Posts: 4
Location: United Kingdom

I'm running ncrunch on a set of tests using xunit, with .Net framework 4.6.1 and nCrunch version 2.22.0.1

When I debug, if I add a watch to a variable I get an error in the format "error CS0103: the name '<variable>' does not exist in the current context"

If I run the test with VS/Resharper test runner it works fine.
Remco
#2 Posted : Wednesday, May 11, 2016 10:22:46 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for sharing this issue.

When NCrunch manipulates the assembly built from your project, it needs to reconstruct the assembly's PDB file. Because MS are constantly updating the compiler and adding new debug metadata, NCrunch is sometimes left behind without knowledge of new metadata elements that have been added. It's possible that you've managed to find one of these.

To solve this problem, I'll need a code sample that can reproduce it. Are you able to whittle this down to a project you can share with me through the contact form?
JamesGrafton
#3 Posted : Wednesday, May 11, 2016 11:58:15 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/17/2016(UTC)
Posts: 4
Location: United Kingdom

Unfortunately I can't as it's another company's source code.

Is there a way for me to find out what's missing?

Thanks,

James
Remco
#4 Posted : Wednesday, May 11, 2016 12:02:23 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi James,

No easy way unfortunately, but usually the structure of debug metadata is defined by the method it's in. For example, methods using yield or async tend to require special handling for their metadata. Copy/pasting the method into an empty solution and knocking out much of its source code may be a way to reproduce it. Make sure you have the same compile settings (i.e. same target framework, etc).
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download