microsoft.identityModel上的Web配置转换-未声明"http://schemas.microsoft.com/XML-Document-Transform"属性 [英] Web config transform on microsoft.identityModel - 'http://schemas.microsoft.com/XML-Document-Transform' attribute is not declared
问题描述
我有一个Web.Release.config,它可以成功转换连接字符串.
I have got a Web.Release.config that is successfully transforming a connection string.
当我添加microsoft.identityModel部分时,我得到一条警告,提示
When I add a microsoft.identityModel section I get a warning saying
"http://schemas.microsoft.com/XML-Document-Transform"属性为 未声明
The 'http://schemas.microsoft.com/XML-Document-Transform' attribute is not declared
并且该转换不适用于该部分.
And the transform doesnt work on that section.
要使转换正常工作,我缺少什么?
What am I missing to get the transform to work?
在此处完成Web.Release.config
Complete Web.Release.config here
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MYNAME"
connectionString="metadata=res://*/Models.MYCOMPANY-Sales-Demo.csdl|res://*/Models.MYCOMPANY-Sales-Demo.ssdl|res://*/Models.MYCOMPANY-Sales-Demo.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=MYCOMPANYDemo;UID=MYCOMPANYDBUser;Password=********;multipleactiveresultsets=True;App=EntityFramework""
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://MYCOMPANY-sales-demo.cloudapp.net/" xdt:Transform="Replace"/>
</audienceUris>
<federatedAuthentication>
<wsFederation realm="http://MYCOMPANY-sales-demo.cloudapp.net/" xdt:Transform="SetAttributes(realm)" />
</federatedAuthentication>
</service>
</microsoft.identityModel>
</configuration>
推荐答案
我也遇到了这个问题,但是已经可以使用了.我所做的是一个全部删除"和一个插入",而不是替换/匹配:
I've run into this also but have gotten it to work. What I did was a "RemoveAll" and an "Insert" instead of a replace/match:
<audienceUris>
<add xdt:Transform="RemoveAll" />
<add value="http://example.com/" xdt:Transform="Insert" />
</audienceUris>
通过这种方式,我得到了所需的转换和输出配置文件.
When I do it that way I get the desired transform and output config file.
这篇关于microsoft.identityModel上的Web配置转换-未声明"http://schemas.microsoft.com/XML-Document-Transform"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!