VS2010 Clean Web.configs-不更新 [英] VS2010 Clean Web.configs - not updating

查看:71
本文介绍了VS2010 Clean Web.configs-不更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2010上搞混了MVC 2.0,并且在使干净的Web配置功能正常工作时遇到了问题.

I'm messing around with MVC 2.0 on VS2010 and am having an issue getting the clean web config feature working.

基本上在我的Web.debug.config我有

<connectionStrings xdt:Transform="Replace">
  <add name="ApplicationServices" 
    connectionString="Server=localhost;Database=SITE_DB;User ID=dbuser;Password=P@ssw0rd;Trusted_Connection=False;" />
</connectionStrings>

and in my `Web.config` I have

      <connectionStrings>
        <add name="ApplicationServices"
             connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
             providerName="System.Data.SqlClient" />
      </connectionStrings>

当我以调试模式运行站点时,我希望xdt:Transform ="Replace"将用Web.debug.config中的内容替换整个connectionStrings部分.

When I run the site in debug mode, I'd expect that xdt:Transform="Replace" would replace the entire connectionStrings section with what is in the Web.debug.config.

我承担错了吗?还是我做其他不正确的事情.对此没有太多信息发布,我想我会问你们.

Am I assuming wrong? Or am I doing something else incorrect. Not much info posted around this and I'd figure I'd ask you guys.

推荐答案

.config转换仅在您以某种方式发布或部署应用程序时发生.如果您只是调试,则转换不会发生.

The .config transforms only occur when you publish or deploy the application in some way. If you're just debugging, the transforms don't happen.

这听起来很疯狂,但直接来自MS代表: http://forums.asp.net/p/1532038/3711423.aspx

This sounds crazy, but it's straight from the mouth of an MS rep: http://forums.asp.net/p/1532038/3711423.aspx

这篇关于VS2010 Clean Web.configs-不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆