配置设置
Configuration Setting
由于错误,App.Config 中不允许此设置
元素应用设置包含无效元素 'BscSerialNumber'。预期的可能元素列表 'add,remove,clear'
<add key="PreValue" value="<BscSerialNumber>"/>
值 <BscSerialNumber>
是我在我的设置中想要的实际字符串。
您需要转义尖括号。使用 <
代替 <
,使用 >
代替 >
。
appsetting 条目最终应如下所示:
<add key="PreValue" value="<BscSerialNumber>"/>
当您读取代码中的设置时,它将包含字符串,包括尖括号:
由于错误,App.Config 中不允许此设置 元素应用设置包含无效元素 'BscSerialNumber'。预期的可能元素列表 'add,remove,clear'
<add key="PreValue" value="<BscSerialNumber>"/>
值 <BscSerialNumber>
是我在我的设置中想要的实际字符串。
您需要转义尖括号。使用 <
代替 <
,使用 >
代替 >
。
appsetting 条目最终应如下所示:
<add key="PreValue" value="<BscSerialNumber>"/>
当您读取代码中的设置时,它将包含字符串,包括尖括号: