2
后,我试图做的是appSettings
transform
一个是在外部文件:变换从外部文件的appSettings合并
下面是external.config
<?xml version="1.0"?>
<appSettings>
<add key="SomeKey" value="some value" />
</appSettings>
的Web.config
<?xml version="1.0"?>
<configuration>
<appSettings file="..\..\external.config">
<add key="SomeKey1" value="some value 1" />
</appSettings>
</configuration>
网络。 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>
我tryed作出共享appSettings
由2个或更多不同project
1阶为WCF Service
秒ASP.NET MVC 4
Application
编辑:
我tryed迁此file
attribute
到Web.Debug.config
但它也不起作用。
的问题是:
我怎么能完成这样的事情是它甚至有可能?
您在上面找到的任何解决方案?谢谢 – sairfan