Deepak Kothari
Deepak Kothari

Reputation: 1753

How to create a mvc project template and use it in VSIX project. The target "TemplateProjectOutputGroup" does not exist in the project

I followed the below steps,

  1. Created a basic MVC application( say MVCTemplate) using predefined template in visual studio
  2. Created a MVCTemplate.vsTemplate for above project using Export template wizard in visual studio
  3. Added the newly created MVCTemplate.vsTemplate and a copy of MVCTemplate.csproj (Renamed to RequiredMVCTemplate.csproj) to the above project
  4. Created a new VSIX project (MVCWizard) in the same solution
  5. In MVCWizard project updated source.extension.vsixmanifest file by adding a new asset MVCTemplate (source = project , Type = Microsoft.visualstudio.Projecttemplate" and path)

Code is as below

<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="MVCTemplate" d:TargetPath="|MVCTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />

I get the below error

The target "TemplateProjectOutputGroup" does not exist in the project. Please suggest the best approcah to create a mvc project template and use it in wizard based vsix project and generate another such mvc application.

Upvotes: 1

Views: 602

Answers (1)

Deepak Kothari
Deepak Kothari

Reputation: 1753

Four steps to follow,

  1. Add the required files or folders in the project.
  2. Update accordingly the csproj of the target project to be created.In this case its RequiredMVCTemplate.csproj
  3. Update vsTemplate file accordingly , using which the project will be generated.In this case its MVCTemplate.vsTemplate
  4. Rebuild the solution. This will ensure it creates a zip file which has the target project template.

Upvotes: 1

Related Questions