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

Notification

Icon
Error

Not loading debug symbols
BrianAdams
#1 Posted : Thursday, April 7, 2016 6:16:10 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/7/2016(UTC)
Posts: 8
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
When debugging a MSTest test, if that test is async, then I always get "does not exist in the current context." when watching local variables. I also get the same thing when debugging non async tests about 50% of the time. When debugging non async tests and I get that, rebooting will often times help, but not always. I have noticed that since installing 2.20.0.4 I get a command window pop up and disappear frequently. This happens when NCrunch seems to be working fine, but whenever I can't see the values of variables the command window has stopped popping up and disappearing.
Remco
#2 Posted : Thursday, April 7, 2016 9:33:19 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,

Thanks for sharing these issues. I'm going to try to separate them from each other so we can troubleshoot them independently.

1. Debug related issues: NCrunch is reliant on custom debug metadata that is emitted by the compiler for async methods and yield iterator blocks. When Roslyn was first released, there were a range of issues where the new custom debug metadata was not being handled correctly by NCrunch and it was being stripped from the .PDB. To my knowledge, all these issues have been since fixed, but MS are constantly changing the the custom metadata formats and it wouldn't surprise me if there's a new hole as a result of a VS update. If you can share a code sample of an async block that consistently blocks your access to local variables, I'd really like to take a closer look at it.

2. Command window popups: NCrunch isn't responsible for creating any visible console windows during its execution, but it does execute user code which may be responsible for doing this. v2.20 introduced a change to the NCrunch task runners where they are now classified as windows applications rather than console applications, and there has been another user that has reported that they're now seeing console windows pop up during test execution. My gut feel is that the change may have had some kind of knock-on behaviour where console windows spawned by test/production code are now becoming visible where they previously weren't. I recommend selectively running your tests until you can find the code responsible for spawning the console window. If you can describe to me how this code is working, I'll investigate whether it's worth reversing the change in v2.20.
BrianAdams
#3 Posted : Friday, April 8, 2016 1:45:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/7/2016(UTC)
Posts: 8
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
1: I'll work on this for you. Unfortunately I can't give you the project I'm working on that fails. It's hundreds of thousands of lines and thousands of files big... The trivial example project I created to try to reproduce failed to reproduce the issue. I'll need to put together something a bit more complex using WebApi, EntityFramework, etc. to hopefully reproduce enough of what we are doing to cause the issue to surface. I'll work on this over the weekend. I did install Update 2 for Visual Studio earlier this week and hadn't noticed the problem before that. Although I also installed the latest version of NCrunch at the same time, so I can't draw any conclusions about possible causes.

2: My team of developers has four other developers on it and we are all experiencing the popup. We have NCrunch configured to constantly run only impacted tests. The window pops up randomly, but it could be when NCrunch runs a test. It happens so fast it may not be a console window, it could be a "Window" window also, it happens so fast only the border is really fully drawn by the time it disappears. The absence of that window popping up randomly seems to correspond with NCrunch not loading debug symbols, but again, that's anecdotal and I can't prove anything.

I'll work on putting together a demo project ASAP for you.
1 user thanked BrianAdams for this useful post.
Remco on 4/9/2016(UTC)
BrianAdams
#4 Posted : Saturday, April 9, 2016 9:00:13 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/7/2016(UTC)
Posts: 8
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
Ok, I put together an example WebAPI project with EF that was a simpler version of a similarly architected project as our production product. I couldn't reproduce it. I then loaded our product and everything was working fine, async and non-async tests. So, it being the weekend, I naturally started to do some work. :) After a couple hours it quit working again. No tests loaded debug symbols. I rebooted and they started working again. Not sure if this helps. Is there a debug dump or anything I can pull/look at when it stops working to help debug this?
Remco
#5 Posted : Saturday, April 9, 2016 10:54:37 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)
This is interesting - are you saying that the problem itself seems to be intermittent rather than method-specific? This is something I haven't seen before, and it's very worrying, because it will make this extremely difficult to track down.

What sort of occurrence pattern do you notice around the problem? Does it appear once, then disappear in the next debug session? Or is it like a magnet - when it starts happening, it keeps happening? Are there certain things that fix it when it appears?

Also, are you using any other build related tools? Such as postsharp or Fody?

When the problem appears, try right clicking on the project involved in the NCrunch Tests Window, then go to Advanced->Browse To Workspace. Can you find the compiled DLL with its matching PDB inside the workspace? Does the PDB look intact?
BrianAdams
#6 Posted : Monday, April 11, 2016 11:29:13 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/7/2016(UTC)
Posts: 8
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
It's definitely intermittent. It seems to correspond with the lack of a popup window. When the Window is popping up fairly regularly then everything works, but when the window stops debug symbols fail to load. But, this is all anecdotal since I can't test that scenario. I let NCrunch run continuously and detect when a test is impacted by a change. Over the weekend I was able to fix it by rebooting my machine, I'll play with it more today and see if restarting VS will also fix it. I am using Postsharp, and I have the tool dll correctly loaded as an additional dependency in NCrunch config. That's one thing I didn't use in my test project, so perhaps it is related. When it fails again today I'll check the PDB and report back.
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.042 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download