all groups > dotnet xml > november 2003 >
You're in the

dotnet xml

group:

Whitespace in app.config


Whitespace in app.config Steve James
11/29/2003 4:47:16 PM
dotnet xml:
Has anyone noticed that the xml in an app.config file is treated differently
than in a web.confg, or is it just me?

I have a component that parses and processes node fragments that are taken
from a .config file. When used in a .NET web app ( web.config ) the
component works fine. However, I found when using the identical node
fragment in a Windows app ( app.config ), I got an error. Basically, the
app.config xml had preserved all the whitespace nodes whereas the web.config
version had stripped them all out. Obviously, the solution is to change my
component so it can cope with either scenario, but I find it strange that
the xml is processed differently in each case.

Is this a feature others have come across, or have I done something idiotic?

Steve James

Re: Whitespace in app.config dbartle NO[at]SPAM steelpoint.com
12/1/2003 10:53:21 AM
[quoted text, click to view]

I'm seeing the exact same behavior. If I run the same code in VS.Net
2002 with the 1.0 framework then there's no problem. However in
VS.NET 2003 in my configuration sections all of the whitespace is
preserved (in my case, \r\n\t...). ConfigurationSettings.AppSettings
AddThis Social Bookmark Button