开发者

Can't use quick watch wile debugin in if statement Visual Studio

开发者 https://www.devze.com 2023-01-27 08:33 出处:网络
The problem looks like this: I have an if statements in my code. if (tcd.TrescWartosc != null) { var document = new ISDocument();

The problem looks like this:

I have an if statements in my code.

if (tcd.TrescWartosc != null)
                    {
                        var document = new ISDocument();
                        document.DocContent = tcd.TrescWartosc;
                        int count = 0;
                        int count2 = 0;
                        count = count + 2;
                    }

It's just a fragment of the code inside the statement and some variables that I've added to test my errors (count and count2) The problem is that when i debug开发者_StackOverflow the project in this one "if" when i check any variable I'm getting 'don't exist in the current context' error. When I comment out the if fragment everything is ok. I've tried with if(true) and the problem remains so what could be the reason for this?? Pin to source also shows nothing...


The problem was visual studio itself...Above I had another if with code and statement like

 if (!tcd.Wyslano)
                    {
                    ...
                    ...
                    }

I wanted to ommit that "if" so I've replaced if (!tcd.Wyslano) with if(false) and Visual Studio had some problem with that...I've replaced it now with if (!tcd.Wyslano && false) and now it debugs ok so i thinks it was kind of VS bug...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号