简体   繁体   English

如何从VS2010中的Web安装项目中排除文件夹?

[英]How to exclude folder from Web Setup project in VS2010?

I want to exclude a folder in a web application from a web setup project in VS2010. 我想从VS2010中的Web安装项目中排除Web应用程序中的文件夹。 I've gone in to the Content Files -> Exclude Filter option in order to filter out some specific files and this works fine. 我进入了“内容文件”->“排除过滤器”选项,以过滤出某些特定文件,并且工作正常。 However, I want to exclude a directory called "External" from the root of the web project,and no matter what I put in the Exclude Filter it always includes it. 但是,我想从Web项目的根目录中排除一个名为“外部”的目录,并且无论我在“排除过滤器”中输入什么内容,它总是包含该目录。

Does anybody know if this option is supposed to be able to exclude folders as opposed to individual files? 有人知道该选项是否应该能够排除文件夹而不是单个文件吗? There are too many to include individually. 有太多内容无法单独包含。 I've tried rules like the following: 我尝试过以下规则:

  1. External\\* 外部\\*
  2. \\External\\* \\外部\\*
  3. ~\\External\\* 〜\\外部\\ *

all to no avail. 一切都无济于事。

Also, I have seen some people mention putting special blocks in the setup project file to exclude stuff, but I couldn't figure out where to put this, or what file they were talking about. 另外,我看到有人提到在安装项目文件中放置特殊块以排除内容,但我不知道该放置在何处或他们在谈论什么文件。 If this is the way to do it, some guidance as to where to put the rules would be appreciated. 如果这是做到这一点的方式,那么将有关在何处放置规则的一些指导会受到赞赏。

I don't want to exclude the folder from the solution project itself, I just want two setup projects, one that includes the folder, one that does not. 我不想从解决方案项目本身中排除该文件夹,我只想要两个安装项目,一个包含文件夹,一个不包含。

Thanks! 谢谢!

After some research I can't find anything that suggests that you can exclude folders. 经过一番研究,我找不到任何建议可以排除文件夹的信息。

You can however edit the csproj-file and set some <ExcludeFromBuild> -tags 但是,您可以编辑csproj文件并设置一些<ExcludeFromBuild> -tags
http://www.meadow.se/wordpress/exclude-files-and-folders-from-web-deployment-projects/ http://www.meadow.se/wordpress/exclude-files-and-folders-from-web-deployment-projects/
This will have the desired effect. 这将具有预期的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM