在Visual Studio 2010中自动部署具有生产配置的网站 [英] deploy website with production configuration automatically in Visual Studio 2010

查看:199
本文介绍了在Visual Studio 2010中自动部署具有生产配置的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Visual Studio 2010发布功能的问题,您在创建网站(MVC框架)后将您的开发人员更改推送到活动网站。



我从来没有工作过MVC直到几个星期前和
我注意到,在推的网站代码之前,我必须改变在任何地方,我有localhost在代码中,并替换为我推的域名至。然后,如果我想调试本地机器上的任何东西,我必须将所有东西都从域名恢复到localhost。



问:有办法不做



基本上,我认为可以归结为需要一个软件包或sth知道使用生产配置部署网站。 / p>

也许有本地分支和现场分支吗?这包括所有时间合并文件。



感谢:)

解决方案

我不确定它是否与MVC一起使用,但我们用于Web服务开发的一种方法是使用 web.config转换



这意味着正常的开发材料在 Web.config 中,我们有单独的配置,取决于部署环境 Web.staging.config Web.production.config


I have a question regarding Visual Studio 2010 publish feature which is used after you create a website (MVC framework) to push your dev changes to the live site.

I've never worked with MVC until a few weeks ago and I've noticed that before pushing the website code I have to change everywhere where I have localhost in the code and replace it with the domain name I'm pushing to. Then if I want to debug anything on my local machine I have to revert everything back to localhost from domain name.

Q: Is there a way to not do this back and front url changing?

Basically I think it boils down to needing a software package or sth that knows to deploy the website with production configuration.

Maybe have a local branch and a live branch? This involves merging files all the time.

Thanks :)

解决方案

I am not sure it works with MVC, but one approach we use for web services development is to use the web.config transformations.

This means that the normal development stuff is in Web.config and we have separate configurations depending on the deployment environment Web.staging.config and Web.production.config.

这篇关于在Visual Studio 2010中自动部署具有生产配置的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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