什么是Web.Debug.config和Web.Release.Config文件? [英] What are the Web.Debug.config and Web.Release.Config files for?

查看:875
本文介绍了什么是Web.Debug.config和Web.Release.Config文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到Visual Studio 2010和MVC 2.0,我注意到在Web.config已经附加了两个额外的文件?用于指定调试和发布具体的设置这些文件,这样你就不会弄乱主要的Web.config?

I just upgraded to Visual Studio 2010 and MVC 2.0 and I noticed the Web.config has two additional files attached to it? Are these files used to specify debug and release specific settings, so you don't clutter up the main Web.config?

难道它甚至有意义分别放置在连接字符串中根Web.config文件中,如果我在调试一个本地和远程之一,并释放Web.configs?

Does it even make sense to place a connection string in the root Web.config file if I have a local and remote one in the debug and release Web.configs respectively?

谢谢!

推荐答案

这是Visual Studio 2010中<新的Web.config改造功能的href=\"http://blogs.msdn.com/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx\">More这里的信息的。

It's the new Web.config transformation feature of Visual Studio 2010. More information here.

编辑:

用于指定调试和发布具体的设置这些文件,这样你就不会弄乱主要的web.config?

Are these files used to specify debug and release specific settings, so you don't clutter up the main web.config?

它不限于三个文件中,可以(在理论上)有尽可能多的文件,有环境。 顶级的Web.config提供你的web配置的模板。根据其提供特定于该环境(如,如果你有本地/台/测试不同的连接字符串/其他)。

It isn't limited to three files, you could (in theory) have as many files as you have environments. The "top level" Web.config provides a template of your web config. The files under it provide replacement values specific to that environment (like if you have different connection strings for local/stage/test/whatever).

难道它甚至有意义放置在连接字符串中根Web.config文件中,如果我有在调试一个本地和远程之一,并分别发布web.configs。

Does it even make sense to place a connection string in the root web.config file if I have have a local and remote one in the debug and release web.configs respectively.

这只会意义,如果它不会环境之间切换。听起来像是你的情况下,它这样做,你的情况不,这是没有意义的把它留在Web.config。

It would only make sense if it wasn't going to change between environments. Sounds like in your case it does so, in your case no, it would not make sense to leave it in the Web.config.

这篇关于什么是Web.Debug.config和Web.Release.Config文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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