我如何prevent从覆盖配置文件“发布网站”? [英] How do I prevent 'Publish Web' from overwriting config files?

查看:153
本文介绍了我如何prevent从覆盖配置文件“发布网站”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发表我的Asp.Net MVC网站到生产服务器(通过VS2008),在web.config和放大器; castle.xml文件将被覆盖。这些文件的内容是我的本地开发环境和生产服务器之间的明显不同。

When I publish my Asp.Net MVC website to the production server (via VS2008), the web.config & castle.xml files are overwritten. The content of these files is obviously different between my local dev environment and the production server.

我如何prevent这些文件被公布?

How do I prevent these files from being published?

推荐答案

在Visual Studio解决方案资源管理器,进入你的web.config文件的属性。确保建设行动是无和复制到输出目录就是不要复制。

In Visual Studio solution explorer, go to your web.config file's properties. Make sure "Build Action" is "None" and "Copy to Output Directory" is "Do not copy".

如果你想在未来的更新,你必须做手工或更改建设行动回内容。下一次你建立(或发布),它会覆盖它。

If you ever want to update it in the future you'll have to do it manually or change "Build Action" back to "Content". The next time you build (or publish) it will overwrite it.

这篇关于我如何prevent从覆盖配置文件“发布网站”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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