更改 Visual Studio 2008 项目中文件夹中整个文件的属性 [英] Change the property of entire files in folder in Visual Studio 2008 project

查看:31
本文介绍了更改 Visual Studio 2008 项目中文件夹中整个文件的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过从资源管理器中拖放来向我的 Visual Studio 2008 项目添加一个文件夹.我想将该文件夹中整个文件的复制到输出目录"属性更改为始终复制".

I was adding a folder to my visual studio 2008 project, by dragging and dropping from explorer. I want to change the 'copy to output directory' property of the entire files in that folder to 'Copy Always'.

问题是文件夹里有很多子文件夹,子文件夹也很多..所以不能屏蔽所有文件,一步修改属性有点烦.

The problem is that the folder contains many subfolders, and so does the subfolders..so it was a little bit annoying not to be able to block all files and change the property in one step.

有没有办法在一个过程中更改包含多个子文件夹的文件夹中所有文件的属性?

Is there a way to change the property of all the files in a folder containing many subfolders in one procedure?

非常感谢...

推荐答案

如果你真的有很多子文件夹&文件,然后您可以尝试这些步骤

If you really have a lot of sub-folder & files then you can try these steps

  1. 创建一个空项目,将你的文件夹添加到项目中
  2. 保存项目并在好的文本编辑器中打开项目文件
  3. 此项目文件现在将包含您要更改其构建操作的所有文件
  4. 删除除内容标签以外的所有其他标签(这些标签是指您的文件)
  5. 做简单的查找&将 //>/n(斜线和尖括号后跟新行)替换为 ">/nAlways/n".(请注意,我使用记事本++,因此转义了斜线).如果您的工具不支持它,您可以随时省略新行.您甚至可以尝试 regex find &如果您的工具支持,请更换.
  6. 您可能需要调整文件路径(如果您的新项目具有不同的文件夹层次结构) - 这可以通过 find &替换 Include=".
  7. 将这些内容节点粘贴到您要修改的项目文件中
  1. Create am empty project, add your folder to the project
  2. Save the project and open the project file in a good text editor
  3. This project file will now have all files for which you want to change the build action
  4. Remove all other tags other than content tags (these refer to your files)
  5. Do simple find & replace to replace //>/n (slash & angled bracket followed by new line) with ">/n<CopyToOutputDirectory>Always<//CopyToOutputDirectory>/n<//Content>". (note that I use notepad++ and hence have escaped slashes). You can always leave out new lines if your tool doesn't support it. You may even try regex find & replace if your tool supports it.
  6. You may have to adjust file path (if your new project has different folder hierarchy) - this can be achieved by find & replace Include=".
  7. Paste these content nodes into the project file that you want to modify

这篇关于更改 Visual Studio 2008 项目中文件夹中整个文件的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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