<appSettings>
<add key="myKeyName" value="DFG&y:yd%yeZ" />
</appSettings>
我在 ASP.NET MVC 应用程序中有一个 web.config 文件。在我的 appSettings 部分中,我有一个键,其值包含一个使 web.config 无效的字符。
该字符是 value="DFG&y:yd%yeZ"中的“&”,如果我删除它,应用程序可以正常工作,当我将其放回去时,我会收到以下错误。
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
解析器错误消息:解析 EntityName 时发生错误。线 25,位置 61。
block 引用>下面我的键以红色突出显示。
<add key="myKeyName" value="DFG&y:yd%yeZ" />
web.config 的 appSettings 键值中是否禁止使用“&”?
最佳答案
关于asp.net-mvc - appSetting 值包含 "&"的 Web.config 文件未被解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28833917/