Alf Nielsen
Alf Nielsen

Reputation: 1382

Debug XML Config file in Visual Studio

Like:


I often need new libraries (new to me) in C# projects I'm working on. Most of them uses a config file (app.config or web.config).

I use an incredible amounts of time, just to get some values in these config files correct, basically because I haven't find any good way to debug, what I'm doing.

Mostly, I follow guides on the web like here on stack overflow, and most off time they do not work, when I just do as people write. I then look at other examples that are written a little different, until I at some point get a correct result.

In my normal programming experience I work with either strongly type code (Like C#) or I try to design the code to be debugable (As you need with JavaScript!, if you don't use overlays like typescript), or I do a lot of Unit testing.

But I haven't found a good (and most important, FAST) way to debug XML config file.

Maybe I'm looking at this problem in a wrong way! So I would really like to hear what other developers do, and how the handle this issue.

Upvotes: 0

Views: 1430

Answers (1)

Steve
Steve

Reputation: 1065

If it's an app.config or web.config... In the immediate or watch window in VS, you can check out the static class (and property) of ConfigurationManager.AppSettings

It's just a key value store, so you can get decent info from it

Upvotes: 1

Related Questions