[英]How do I change which files by default have build property of content in visual studio
When adding a PDF, CSV, etc... to a project I have to go to the properties of every file and change the build action to Content. 将PDF,CSV等添加到项目中时,我必须转到每个文件的属性并将构建操作更改为“内容”。
Is there a way to change the list of extensions that are recognized in a project so that this will happen when I include a pdf or csv in my project automatically. 有没有一种方法可以更改项目中可以识别的扩展名列表,以便当我在项目中自动包含pdf或csv时会发生这种情况。
Thanks, 谢谢,
This blog post by Andre Loker describes the process in great detail. Andre Loker的这篇博客文章详细介绍了该过程。 The relevant section appears to be this:
相关部分似乎是这样的:
The default build action of a file type can be configured in the registry.
可以在注册表中配置文件类型的默认生成操作。 However, instead of hacking the registry manually, we use a much better approach: pkgdef files ( a good article about pkgdef files ).
但是,与其使用手动方法破解注册表,不如使用更好的方法:pkgdef文件( 有关pkgdef文件的好文章 )。 In essence, pkdef are configuration files similar to .reg files that define registry keys and values that are automatically merged into the correct location in the real registry.
本质上,pkdef是类似于.reg文件的配置文件,这些文件定义了注册表项和值,这些注册表项和值会自动合并到真实注册表中的正确位置。 If the pkgfile is removed, the changes are automatically undone.
如果删除了pkgfile,则更改将自动撤消。 Thus, you can safely modify the registry without the danger of breaking anything – or at least, it's easy to undo the damage.
因此,您可以安全地修改注册表,而不会破坏任何内容–至少可以很容易地消除损坏。
But here's an example of what you need to set: 但是,这是您需要设置的示例:
[$RootKey$\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\FileExtensions\.spark]
"DefaultBuildAction"="Content"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.