开发者

How do I use Visual Studio 2010 config transforms for the applicationSettings section of the web.config?

开发者 https://www.devze.com 2022-12-28 10:55 出处:网络
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 wan

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号