有没有办法在App_Data中保留文件在发布时覆盖较新的文件? [英] Is there a way to keep files in App_Data from overwriting newer files when publishing?

查看:241
本文介绍了有没有办法在App_Data中保留文件在发布时覆盖较新的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在App_Data中使用XML文件与Intranet应用程序主页面上的Repeater结合使用,可以在用户登录应用程序状态,维护等时向用户显示消息。为了测试功能,这将是很好的将文件放在App_Data文件夹的开发中,但是如果我这样做,那么当我发布应用程序时,它会将其复制到生产服务器上的文件上。有没有办法防止这种情况发生在没有进行Web部署项目(并且会解决我的问题)?

I use an XML file in App_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc. To test the functionality, it would be nice to have the file in the App_Data folder under development, but if I do this it copies it over the file on the production server when I publish the application. Is there anyway I can prevent this from happening short of going to a Web Deployment project (and will that solve my problem)?

推荐答案

在Visual Studio 2005中,我看到一个复选框,标记为包含App_Data文件夹中的文件,默认为该选项。您是否尝试发布,该复选框未选中?

In Visual Studio 2005, I see a checkbox labeled "Include files from the App_Data folder", which defaults to checked. Have you tried publishing with that checkbox unchecked?

编辑:看到该复选框不可用于您的项目,我会研究使用可视化的 VS2005 Web部署附加组件工作室。我没有使用它,但是在调试和发布模式之间自定义发布的功能看起来很有希望。

Seeing as how that checkbox isn't available for your project, I would look into using the VS2005 Web Deployment add-on for visual studio. I haven't used it myself but the features to customize publishing between debug and release mode looks promising.

这篇关于有没有办法在App_Data中保留文件在发布时覆盖较新的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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