简体   繁体   中英

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.

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.

Thanks,

This blog post by Andre Loker describes the process in great detail. 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 ). 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. If the pkgfile is removed, the changes are automatically undone. 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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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