Iis appcmd set config appSettings-带加号(+;)的值正在转换为空格

Iis appcmd set config appSettings-带加号(+;)的值正在转换为空格,iis,iis-7.5,appcmd,Iis,Iis 7.5,Appcmd,我试图使用appcmd在web.config中设置appSetting,appSetting的值包含+符号。运行appcmd时,会创建appSetting,但+会转换为空格 我正在运行的appcmd: "C:\system32\inetsrv\appcmd.exe" set config "Default Web Site" /section:appSettings /+"[key='Test',value='++ ++']" 创建的应用程序设置: <add key="Test" val

我试图使用appcmd在web.config中设置appSetting,appSetting的值包含+符号。运行appcmd时,会创建appSetting,但+会转换为空格

我正在运行的appcmd:

"C:\system32\inetsrv\appcmd.exe" set config "Default Web Site" /section:appSettings /+"[key='Test',value='++ ++']"
创建的应用程序设置:

<add key="Test" value="     " />

我尝试在appcmd中使用%2b而不是+,但没有效果(它在appSetting中仅转换为“b”)


有人知道在使用appcmd时如何在appSetting中包含+符号吗?

您是否尝试过使用unicode的+值,即
%u002b

"C:\system32\inetsrv\appcmd.exe" set config "Default Web Site" /section:appSettings 
/+"[key='Test',value='%%u002b']"
您需要添加额外的%符号,以便在unicode值中转义%

这将导致测试键的值为+

见: