Publish Web.Release.config to IIS from VS, web deploy, one-click publish
I have a few appSetting entries in my web.config.
I have some different entries in web.Release.config that I would like to push to IIS(7) when I publish. (I am publishing using the one-click publish in VS2010 using the web deploy method).
When I publish to IIS and run the app, the app is getting the values from web.config and not web.release.config.
(I am in the Release configuration when I publish).
What am I missing ?
[EDIT]
The 开发者_Go百科app settings section of the web.release.config:
<appSettings>
<add key="StylesheetPath" value="http://mySite/Stylesheet/"/>
<add key="ImagePath" value="http://mySite/Stylesheet/images/"/>
</appSettings>
Thanks
In your web.release.config's appSettings node, add a transform attribute
<appSettings xdt:Transform="Replace">
<add key="StylesheetPath" value="http://mySite/Stylesheet/"/>
<add key="ImagePath" value="http://mySite/Stylesheet/images/"/>
</appSettings>
This xdt:Transform tells the config builder to take the appSettings node in your web.config and replace it with this one. When you deploy it, the web.config should be updated.
精彩评论