How to debug static classes in Visual Studio?

928 Views Asked by At

Edit: original question:

This piece of C# code is not working correctly:

using System.Configuration;

...
    public string GetConfiguration(string key)
    {
        String value;
        var appSettings = ConfigurationManager.AppSettings;

This is a part of a DLL, referring to an executable, which has been replaced by another DLL, referring to another executable in another location, ..., as you can guess, something went wrong with the locations of the executables' or DLL's locations (although I've copied the *.config files).

My piece of code is not able to find any configuration entries, which means that it is looking for those entries in a wrong place, and that's my question: how can I know in which file the ConfigurationManager is looking?
When add ConfigurationManager to the watch-window in Visual Studio, this is what I get:

ConfigurationManager
error CS0119: 'ConfigurationManager' is a type,
              which is not valid in the given context

Edit
In the meantime I've discovered that the configuration file of the executable had not been replaced, causing the issue, but the following more general question keeps intact:

How can I see the properties/fields of a static class in a Visual Studio watch-window?

0

There are 0 best solutions below