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

Notification

Icon
Error

2 Pages12>
Debugger visualizers not working anymore after update to 3.22.1
codedevote
#1 Posted : Sunday, December 9, 2018 8:56:40 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/29/2018(UTC)
Posts: 5
Location: Germany

Hi,

I updated to 3.22.1 and now debugger visualizations aren't working anymore. They do work when e.g. using VS test runner to debug a test, so I assume it's not an obvious VS issue. I nevertheless ran a VS "Repair" installation, which didn't help either. All test were running fine with the last version I had installed (I think it was 3.18, not 100% sure anymore). It is also not happening for each test project in the solution, only a few. I compared csproj files of "working test project" and "not working test project" but could not spot any relevant difference. All of those test projects are on .NET 4.7.2 and most of the projects under test are netstandard2.0.
I tried to downgrad to 3.18 and 3.21, but had the same issue with those versions as well.

Environment:
VS 2017 15.9.3
NCrunch 3.22.1 (also tried 3.21)
OzCode 3.1.0.3913

I can provide further details and/or logs, just tell me what you need.

Thanks
Florian
Remco
#2 Posted : Sunday, December 9, 2018 11:29:10 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

There haven't been any changes to NCrunch's debugger integration or anything PDB related for a good many versions now, so this is probably an unrelated breakage.

When you talk about debug visualizations, what do you mean? Is this the analysis of variable tooltips?

Do the intermediate and watch windows work correctly?

Does this seem to only happen when running tests with NCrunch, or does it also happen when you run your software directly?
codedevote
#3 Posted : Sunday, December 9, 2018 11:36:07 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/29/2018(UTC)
Posts: 5
Location: Germany

Hi, thanks for your quick reply.

Talking about debug visualizations I mean the variable tooltips that you get when hovering the mouse over your code.

Adding a quickwatch or a watch for a variable results in "error CS0103: The name 'variableNameHere' does not exist in the current context" being displayed as its value, so those aren't working as well.

When I run those tests with VS test runner, debugger tooltips / watch windows, ... work as expected. As I described in my initial post, this is not happening in all test projects. Some of them work pretty fine debugging them with Ncrunch.

I am happy to provide more information if you require.

Florian
Remco
#4 Posted : Sunday, December 9, 2018 11:00:12 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Florian,

Have you noticed that there are certain regions of code that work within the file, but other regions that don't?

It may be something to do with the structure of the PDB file that has been rebuilt by NCrunch.

Which version of .NET are you using in the projects that are failing?

Do breakpoints work correctly within the affected areas?
codedevote
#5 Posted : Monday, December 10, 2018 9:27:38 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/29/2018(UTC)
Posts: 5
Location: Germany

Hi Remco,

.NET version of test projects is .NET 4.7.2, projects referenced by test project are either 4.7.2 or netstandard2.0.

I tried all tests within the class and none of those showed the tooltips during debugging. I tried another test class from the same project and there it worked. I then added a Dummy-Test to the offending class and it worked for the dummy test.
The dummy test looked like this:

[Fact]
public void Dummy()
{
var id = Guid.NewGuid();
var other = id;
}

What's interesting is, that when I use NCrunch "Break into test at this line" feature on the closing '}', it sets the breakpoint to the line beginning with 'var id...'. On all other lines, it works as expected and sets the breakpoint at the expected line.
I tried this for the other methods and some seem to correctly set the breakpoint, while others differ by a few lines of code.
I also switched NCrunch workspace directory from my ramdrive to a local drive, to make sure files aren't corrupted by the underlying storage. I had the same effect after switching workspace base path.
Remco
#6 Posted : Monday, December 10, 2018 10:50:49 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
There is a known problem in the current NCrunch build where the 'Break into test at this line' feature isn't always mapping its target line correctly for files that have just been edited. This will be fixed in the next version and it isn't related to the debug issues.

The problem as you've described it looks like it's originating from the debugger's inability to load variable-based symbols from the PDB file. Where we've seen this before, it's been caused by changes made to the PDB structure to deal with compiler-generated code, such as 'async' and 'yield' structures. Do the broken areas of your test project have anything in common in regards to use of compiler generated code or new C# features? If you're able to produce a sample solution that can reproduce this problem, I should be able to analyse it and maybe produce a fix.
codedevote
#7 Posted : Wednesday, December 12, 2018 8:06:49 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/29/2018(UTC)
Posts: 5
Location: Germany

Yes, the broken areas of the test class are all async methods. The dummy test I added stops working, if I turn it into an async method returning a task and adding a Task.Delay(100) to the method body. I tried for 2 hours to create a repro, but I am unable to reproduce the phenomen in the repro project. The strange thing is, that in my test projects it is also only affecting a single class. Other test classes within the test project (even async test methods) work fine. I am not sure, how to come up with a repro for this strange issue. I can't share all the code with you, but we could either setup a remote session, so you can have a look or I could maybe share the VS generated PDB and the NCrunch generated PDB. Not sure, what would actually help you.
Maybe there is also another way. E.g. could I force NCrunch to use the VS generated PDB (to verify its working with that one) or somehow make the VS and NCrunch PDB comparable for you?
Remco
#8 Posted : Wednesday, December 12, 2018 12:48:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Unfortunately, there isn't really any way for me to analyse this issue without having a sample solution that can produce it. This is one of those areas where debugging over someone's shoulder can only yield very limited information, because the problem is actually manifesting in MS's debugger, which is very much a black box to me. Troubleshooting these issues involves very extensive deduction and guesswork to try and establish what the debugger is expecting to find in the PDB file and why it isn't being provided (there are no error messages in this area).

The good news is that in a few months time, the issue may actually be resolved as a result of other development. Right now we're extensively reworking the area of NCrunch that reconstructs the PDB files, mostly because we need to add support for the new portable PDB format that was introduced with .NET Core. The portable PDB format is much cleaner and is an open standard, whereas the legacy format being used right now is an ancient piece of machinery that the world is trying very hard to move away from. It's my hope that when the new portable PDB system is in place, you can simply switch over to it at the problem will be gone. Of course, this speculative and it will probably be 2-4 months before we have anything available in this area.
codedevote
#9 Posted : Thursday, December 13, 2018 9:58:12 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/29/2018(UTC)
Posts: 5
Location: Germany

Ok, I understand. I will try again over the weekend to create a sample that reproduces the issue. If that doesn't work, I will have to workaround the issue until the version arrives, that uses the new pdb format. Thanks for your help so far.
EricZimmerman
#10 Posted : Saturday, January 12, 2019 1:36:42 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/6/2016(UTC)
Posts: 10
Location: United States of America

Was thanked: 1 time(s) in 1 post(s)
another vote for getting this resolved. it is maddening to not be able to see variable values for anything when debugging.
playtime222
#11 Posted : Tuesday, March 5, 2019 5:45:09 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/5/2019(UTC)
Posts: 15
Location: Netherlands

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Upvote for a fix. Some details - NCrunch 3.22.0.1, .NET 4.7.2, PostSharp 6.0.35, VS 15.9.7. When a debug session is started on some tests (480 tests, 2 problems so far) from NCrunch, locals are not available in the debugger window. Running the test from VS Test Explorer does not have same issue. So, yeah I have a workaround but :( Also, you can have access to the Azure project if you need a code base to work with.
Remco
#12 Posted : Tuesday, March 5, 2019 9:50:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks. We've been making progress on the new PDB system. It's still at best a couple of months away, but I'm becoming more convinced that it will solve problems like this.
tasoss
#13 Posted : Sunday, March 17, 2019 12:36:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/15/2019(UTC)
Posts: 4
Location: Greece

Hello.
It's an important problem and a fix would be really appreciated.
Take your time of course ;)
warappa
#14 Posted : Friday, May 17, 2019 6:08:27 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/19/2016(UTC)
Posts: 5
Location: Austria

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi @Remco,
in a solution containing only "netstandard2.0" and "netcoreapp2.0" projects, I can debug the tests with NCrunch, but locals are not recognized with CS0103 in watch window (locals work when debugging with Test Explorer). From what I read here it seems like it relates to the issue with the new PDB format.

Is there any update on when support for the new PDB format is available?

Visual Studio 2019 16.0.4
NCrunch 3.27.0.3
Remco
#15 Posted : Friday, May 17, 2019 11:34:35 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, sorry the new CIL based system is still a work in progress. I'd like to give an ETA, but the truth is that with the platform going the way it has been, we're not really in charge of our own schedule at the moment. I can promise you that we're working on it as a matter of priority.
Remco
#16 Posted : Monday, May 20, 2019 6:39:55 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
tasoss
#17 Posted : Thursday, June 6, 2019 9:53:54 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/15/2019(UTC)
Posts: 4
Location: Greece

Hello again and thanks for the feedback.
I have tried version 3.28 and it seems that debugging is working again(on vs 2017).
Thanks!
Remco
#18 Posted : Thursday, June 6, 2019 9:55:26 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
tasoss;13567 wrote:
Hello again and thanks for the feedback.
I have tried version 3.28 and it seems that debugging is working again(on vs 2017).
Thanks!


Awesome, thanks for confirming!
tasoss
#19 Posted : Friday, June 14, 2019 5:31:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/15/2019(UTC)
Posts: 4
Location: Greece

I would like to ask you if it's normal ,that while debugging, i step into nunit's(using step over (F10)) framework code?
Can i somehow disable it?
Thanks!
Remco
#20 Posted : Friday, June 14, 2019 11:28:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
tasoss;13592 wrote:
I would like to ask you if it's normal ,that while debugging, i step into nunit's(using step over (F10)) framework code?
Can i somehow disable it?
Thanks!


Hi! This isn't controlled by NCrunch. It's possible you have an IDE/debugger setting turned on that is doing this. Perhaps check the 'Just My Code' debugging setting in VS?
Users browsing this topic
Guest
2 Pages12>
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.113 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download