I just upgraded to Visual Studio 2010, and I am playing around with the Config transforms option for web application projects. I see in the example file how to change the connection strings, but I want to change settings in the applicationSettings (Not appsettings) section. I have not been able to find any information 开发者_Go百科on this.
I tried the following which worked, but I thought there might be a better way:
<applicationSettings>
<MyDashboard.Web.Properties.Settings>
<setting name="SomePath" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)">
<value>c:\somewhere test</value>
</setting>
</MyDashboard.Web.Properties.Settings>
</applicationSettings>
Try this. It will replace all the applicationSettings node.
<applicationSettings xdt:Transform="Replace">
<MyDashboard.Web.Properties.Settings>
<setting name="SomePath" serializeAs="String">
<value>c:\somewhere production</value>
</setting>
</MyDashboard.Web.Properties.Settings>
</applicationSettings>
Semi-related ... check out the SlowCheetah VS add-in at ... visualstudiogallery
精彩评论