【发布时间】:2014-11-11 01:25:56
【问题描述】:
当我在 .net 中构建解决方案时,由于 app.config 文件中的此链接,它会显示错误。我想我需要逃避一些角色。请提出建议。
<?xml version="1.0"?>
<!-- For more information on using app.config transformation
visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="MarketSolutionUrl"
value="http://www.example.com/Search?sid=90&cid=329&lid=1033"/>
</appSettings>
</configuration>
http链接中哪些字符需要转义?
<add key="MarketSolutionUrl"
value= "http://www.example.com/Search?sid=90&cid=329&lid=1033"/>
我尝试了&=&amp,但它仍然给出错误。请指教。
【问题讨论】:
-
& 没有转义为 &... 它应该是 & (注意分号)但这不重要。重要的是您在哪里使用该值...
-
@TJMonk15:是什么让您认为无效的 XML 无关紧要?
标签: c# .net xml app-config