Home » Microsoft TechnologiesRSS

Setting project type of project template packaged in vsix

I have been trying to set up project type (and also project subtype) of project template and package it in .VSIX. In particular, problem is setting ProjectType to Web and ProjectSubType to CSharp (as explained on MSDN) which makes 'New Project' not showing my template anywhere. Setting only ProjectType to CSharp works properly. 

Fragment of my 'MyTemplate.vstemplate' looks like this:

<TemplateData><Name>My MVC Web Application</Name><Description>&lt;No description available&gt;</Description><ProjectType>CSharp</ProjectType><ProjectSubType></ProjectSubType><SortOrder>1000</SortOrder><CreateNewFolder>true</CreateNewFolder><DefaultName>MyMVCWebApplication</DefaultName><ProvideDefaultName>true</ProvideDefaultName><LocationField>Enabled</LocationField><EnableLocationBrowseButton>true</EnableLocationBrowseButton><Icon>__TemplateIcon.ico</Icon></TemplateData>

Is there a way to put my project template (packaged in .VSIX) under 'Web' category?

 

4 Answers Found

 

Answer 1

It sounds like you might have those backwards; the ProjectType must still be CSharp (it is the ProjectSubType that must be set to Web).
 

Answer 2

Hi Aleksandarant,

Thanks for your post.

To acheve your goal, I think you can <OutputSubPath> to the project  file,

when you create a C# project template  in file->new->project->C# project template,

unload the project by right click the project node in solution explorer-> unload project,

replace the line

VSTemplateInclude="ProjectTemplate1.vstemplate" />

to

<VSTemplateInclude="ProjectTemplate1.vstemplate" >

<OutputSubPath>Web</OutputSubPath>

</VSTemplate>

For more information, please check

http://blogs.msdn.com/b/visualstudio/archive/2010/03/04/creating-and-sharing-project-item-templates.aspx

Hope this can help.

 

Best Regards,

Ziwei Chen

 

 

Answer 3

Hi again,

Is it resolved?

/V

 

Answer 4

Thanks for your thorough explanation, problem is resolved.
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter