So I have an App.config file setup something like this:
<configuration>
<appSettings>
<add key="Description" value="My too long of a\n description that needs\n new lines so the entire\n thing can be seen."/>
</appSettings>
</configuration>
Now, at run-time, I need to change the Text
property of a Label
to one of these many descriptions located in the App.config file. If I include the new line character in the App.config, the Label
seems to ignore that it is a new line character and instead prints it out literally. However, if I were to remove these new line characters and insert them at run-time, then the Label
will recognize them and insert new lines as it should.
My question is, why? Why does the Label
ignore them and print them out literally if they come from the App.config?
To use this description from the App.config, this is all I'm doing:
myLabel.Text = ConfigurationManager.AppSettings["Description"];