我想做的是transform其中之一appSettings在外部文件中:
这是external.config
<?xml version="1.0"?>
<appSettings>
<add key="SomeKey" value="some value" />
</appSettings>
网页配置
<?xml version="1.0"?>
<configuration>
<appSettings file="..\..\external.config">
<add key="SomeKey1" value="some value 1" />
</appSettings>
</configuration>
Web.Debug.config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="SomeKey" value="some changed value"xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
在正确构建之后configuration,在我的示例中Debug只有这个:
<?xml version="1.0"?>
<configuration>
<appSettings file="..\..\external.config">
<add key="SomeKey1" value="some value 1" />
</appSettings>
</configuration>
但应该是:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="SomeKey1" value="some value 1" />
<add key="SomeKey" value="some changed value"/>
</appSettings>
</configuration>
我试图让appSettings2 个或更多不同project的 1-st共享WCF Service第二个ASP.NET MVC 4 Application
编辑:
我试图将其移至file attribute,Web.Debug.config但它也不起作用。
问题是:
我怎么能完成这样的事情?甚至可能吗?