[英]Change the property of entire files in folder in Visual Studio 2008 project
I was adding a folder to my visual studio 2008 project, by dragging and dropping from explorer. 我通过从资源管理器中拖放来为我的visual studio 2008项目添加一个文件夹。 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? 有没有办法在一个过程中更改包含许多子文件夹的文件夹中的所有文件的属性?
Many Thanks... 非常感谢...
Just expand all the folders. 只需展开所有文件夹即可。 Select all the files at once, and change the Build Action to "Copy Always".
一次选择所有文件,并将构建操作更改为“始终复制”。 You can select the top item, hold shift, select the last item and that will select all items.
您可以选择顶部项目,按住shift,选择最后一项,然后选择所有项目。
If you really have a lot of sub-folder & files then you can try these steps 如果你真的有很多子文件夹和文件,那么你可以尝试这些步骤
//>/n
(slash & angled bracket followed by new line) with ">/n<CopyToOutputDirectory>Always<//CopyToOutputDirectory>/n<//Content>"
. ">/n<CopyToOutputDirectory>Always<//CopyToOutputDirectory>/n<//Content>"
简单查找和替换以替换//>/n
(斜线和斜角括号后跟新行)。 (note that I use notepad++ and hence have escaped slashes). Include="
. Include="
来实现。 Only way I know is to edit the csproj file. 我只知道编辑csproj文件。 You could create a utility to help you do this.
您可以创建一个实用程序来帮助您执行此操作。
A quick test i did yielded the following. 我做了一个快速测试,结果如下。
<Content Include="Test.css" />
After changing the properties... 更改属性后......
<Content Include="Test.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.