views:

34

answers:

2

Hi I want to add for example using System.IO; for the QuickWatch. And i don't know how.

My objective is to whenever i want to see the value of a certain expression for example Path.Combine("C:\","test"); i want to be able to see the result in the quick window. But i can't i have to add 'System.IO' in the quick watch before 'Path.combine...' and then reevaluate in order to see the output.

I want to add for example namespaces such as 'System.IO' 'System.Threading'.... Is that feasible and how? Thank you

A: 

Why do you want to add a namespace to the watch window. Instead add the object to which the value is stored, in the quick watch window and observe the value over each step.

You will be storing the Path.Combine to a string variable. Put that variable inside the watch window.

Edit:

If you add a reference to the System.IO namespace in your code behind file then you can use Path.Combine in the quickwatch window without adding System.IO.Path.Combine

rahul
However what you remarked in your edit, has raised some questions.It's true that if I add the namespace, the quickwatch will display the 'Combine' output...... In a test application. I tried itBut thinking about it, I will always be in that case, i.e. using the namespace directive in the class header, of course, how could i run it otherwise. The problem is that sometimes the quickwatch does not resolve this namespace. And it also happens to me with other namespaces and classes.So my question is obsolete now, it's 'Is there a bug with VS quickwatch?
LolaRun
A: 

It's probably a visual studio bug. Because when i checked it, according pulse's answer. it made a point, and i left it since then. But from time to time, the problem is recurring, for no obvious reasons at all. Many other examples, other than 'Path.Combine("Test","one")' using quickwatch, it will require the full namespace before the 'Path' class. And theoretically, my question is not really valid. Since whatever code in the class, must already have its namespaces defined in the header of the class or in the line itself, otherwise you will have a compilation error. So the occurence of this problem, has to indicate a bug/problem. It probably occurs on different build options, or optimization... or whatever.

If anybody has more details on this, please don't hesitate to share. Thanks.

LolaRun