切换在ASP.NET开发/ UAT /生产环境之间的配置的最佳方式? [英] Best way to switch configuration between Development/UAT/Prod environments in ASP.NET?

查看:235
本文介绍了切换在ASP.NET开发/ UAT /生产环境之间的配置的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有3种环境切换发展我的web应用程序的时候 - 开发,UAT和正式版。我对所有3我见过切换这些设置,通过改变所有引用,然后重建解决方案手动完成,同时还与preprocessor指令完成了我的配置文件,不同的数据库连接。有没有简单的方法,这样做基于一些变量,这样的配置不会每次都部署到一个新的环境时,被修改?

I need to switch among 3 different environments when developing my web app - Development, UAT, and Prod. I have different database connections in my configuration files for all 3. I have seen switching these settings done manually by changing all references and then rebuilding the solution, and also done with preprocessor directives. Is there an easy way to do this based on some variable so that the configuration doesn't have to be revised when deploying to a new environment every time?

推荐答案

要我似乎可以从的 Visual Studio 2005的Web部署项目秒。

就这样,你可以告诉它更新/修改你的web.config文件的各个部分取决于生成配置。

With that, you can tell it to update/modify sections of your web.config file depending on the build configuration.

看看从斯科特谷快速了解/样品。

这篇关于切换在ASP.NET开发/ UAT /生产环境之间的配置的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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