如何对 web.config 的 applicationSettings 部分使用 Visual Studio 2010 配置转换?
我刚刚升级到 Visual Studio 2010,并且正在尝试 Web 应用程序项目的配置转换选项。我在示例文件中看到如何更改连接字符串,但我想更改 applicationSettings (不是 appsettings)部分中的设置。我无法找到任何这方面的信息。
我尝试了以下有效的方法,但我认为可能有更好的方法:
<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>
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 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
半相关...查看 SlowCheetah VS 加载项...视觉工作室画廊
Semi-related ... check out the SlowCheetah VS add-in at ... visualstudiogallery
试试这个。它将替换所有 applicationSettings 节点。
Try this. It will replace all the applicationSettings node.