Visual Studio 2010中可以应用调试或发布转换来的Web.config,但对于Azure的设置? [英] Visual Studio 2010 can apply Debug or Release transformations to Web.config, but what about the Azure settings?

查看:217
本文介绍了Visual Studio 2010中可以应用调试或发布转换来的Web.config,但对于Azure的设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须手动编辑在Azure连接字符串自己生产和发展之间切换,或者是有什么比得上转型的Visual Studio应用到Web.config中?

Do I have to manually edit the Azure connection strings myself to switch between production and development, or is there something comparable to the Transformation Visual Studio applies to Web.Config?

推荐答案

要添加什么布伦特说。我用一个特制的小仅配置(配置)项目,该项目包含每个部署类型的文件夹 - 每个文件夹里面是那些对特定部署定制的.config和.cscfg文件集合(几部分.config文件太多)。在每次通过pre-生成事件步编译时,Visual Studio将文件从正确的文件夹成Config项目的根文件夹中的文件。结果
这是我在pre-生成事件命令行使用命令:

To add to what Brent has said. I use a special small configuration-only (Config) project that contains a folder for every deployment type - inside each folder there is a collection of .config and .cscfg files that are tailored toward a specific deployment (a few partial .config files too). During every compile via Pre-Build event step, Visual Studio copies the files from the correct folder into the root folder of that Config project.
This is the command I use in the Pre-Build Event Command Line:

xcopy /Y "$(ProjectDir)$(ConfigurationName)\*.config" "$(ProjectDir)"
xcopy /Y "$(ProjectDir)$(ConfigurationName)\*.cscfg" "$(ProjectDir)"

在解决方案中的链接配置文件从根每隔项目的配置项目的文件夹中。

Every other project in the solution links to the configuration files from the root folder of the Config project.

我也用配置的转换,以及为生产与非生产环境。一切非生产(本地开发环境,Azure的QA开发环境)有很多的调试和追踪内置的 - 错误完全恢复到客户端的/ etc。生产环境的锁定。

I also use config transformations as well, for Production vs. Non-production environments. Everything non-Production (local development environment, Azure-QA development environment) has a lot of debug and tracing built in - errors are returned completely to the clients/etc. Production environment has that locked down.

编辑:写了这个博客终于<一个href=\"http://www.paraleap.com/blog/post/Managing-environments-in-a-distributed-Azure-or-other-cloud-based-NET-solution.aspx\" rel=\"nofollow\">http://www.paraleap.com/blog/post/Managing-environments-in-a-distributed-Azure-or-other-cloud-based-NET-solution.aspx

wrote a blog about this finally: http://www.paraleap.com/blog/post/Managing-environments-in-a-distributed-Azure-or-other-cloud-based-NET-solution.aspx

由于布伦特指出,这是不是有暂存区域是一个全面的测试网站是个好主意。这是迈向一个快速烟雾测试,以及在不考虑你的主站下部署新封装成的Azure一个伟大的方式更为适合。 (生产和部署之间的IP交换通常不会引起用户的任何问题)

As Brent pointed out, it is not a good idea to have Staging area to be a full-blown Testing site. It is more geared toward a quick smoke test as well as a great way to deploy a new package into Azure without taking your main site down. (IP swap between Production and Deployment usually does not cause any issues to users)

希望这有助于

这篇关于Visual Studio 2010中可以应用调试或发布转换来的Web.config,但对于Azure的设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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