Newline and Return characters in app.config

M

Mike

I seem to be having some troubles inserting newline and return characters into my app.config file (I have them there for serial port newline settings). I can add them as (ampersand)#xA; and (ampersand)#xD; directly in the app.config XML, but if I (or any future developer) launches the settings page in Viaual Studio the values get wiped out. I have tried double quotes and escape characters all with no luck.

Anyone else run into this

From http://www.developmentnow.com/g/36_2005_3_0_28_0/dotnet-languages-csharp.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Mike said:
I seem to be having some troubles inserting newline and return characters
into my app.config file (I have them there for serial port newline
settings). I can add them as (ampersand)#xA; and (ampersand)#xD; directly
in the app.config XML, but if I (or any future developer) launches the
settings page in Viaual Studio the values get wiped out. I have tried
double quotes and escape characters all with no luck.

Anyone else run into this?

I did a time ago, but I had no time to find the best way so I did it the
fast way :)
I just created a code like |NL| which I later replace in the code:
AppSettings["code"].Replace("|NL|", Environment.NewLine)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top