Reputation: 5855
When I run my Web.config transforms, it converts the >
symbol to >
. Is there a way to escape this conversion?
input:
<add key="MyPassword" value=">" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
undesired output:
<add key="MyPassword" value=">" />
desired output:
<add key="MyPassword" value=">" />
Upvotes: 0
Views: 737
Reputation:
The Nature of XML prevents this.
In an effort to not leave you hanging here are some suggestions.
google CDATA in Web.config,
You may wish to create a method that 1. Reads the setting and 2. Decodes the value.
With that being said, the nature of XML read and writes, this value should be returned unencoded. I see you are working with MVC. Just as a pointer perhaps this is working as intended and you simply need to @Html.Raw() your output in your view? Just a guess.
Good luck.
Upvotes: 0
Reputation: 2238
Unfortunately it looks like this is expected behavior. In this related question you can see the user submitted a bug to Microsoft, which they have closed as "By Design".
Web Config Transforms are HTML Encoding some of the config and breaking it
Upvotes: 1