CONFIGURATIONMANAGER.APPSETTINGS CONVERT “\N” TO “\\N” WHY?

jacob rasel

Total Post:88

Points:616
Posted by  jacob rasel
 919  View(s)
Ratings:
Rate this:

I have a AppSetting in web.config.

<add key="key" value="\n|\r"/>

When i read it by ConfigurationManager.AppSettings["key"] it gives "\\n|\\r". Why ?

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: ConfigurationManager.AppSettings convert “\n” to “\\n” why?

    Hi Jacob, 

    try this:

    ConfigurationManager.AppSettings["Key"].Replace("\\n", "\n")

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!