How do you create a VSTemplate so that it automatically sets the build action as "content" not the default which is "none"?
Click in the solution explorer the file that will be modified. Then hit F4 or click with the right button in the file and then select the "Properties" option. In the Properties window, change Build Action to Embedded Resource. Save this answer.
The BuildAction property indicates what Visual Studio does with a file when a build is executed. BuildAction can have one of several values: None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.
Set a build action Or, right-click on the file in Solution Explorer and choose Properties. In the Properties window, under the Advanced section, use the drop-down list next to Build Action to set a build action for the file.
Create a multi-project template from an existing solutionOn the Project menu, choose Export Template. The Export Template Wizard opens. On the Choose Template Type page, select Project Template. Select one of the projects that you want to export to a template, and then choose Next.
According to this post, instead of specifying SubType
, you should specify the ItemType
attribute to 'Content'.
<ProjectItem ItemType="Content" ... > ... </ProjectItem>
I tried it and it works! (and yes, it's not very intuitive)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With