How to add a custom project template to a new Asp.Net MVC 3 project dialog?

I am developing a plug-in application using MEF and Asp.NET MVC 3, and I want to create a custom project template to provide third-party developers with new plug-ins for the application.

I can easily export it as a project template, but since the host is developed in ASP.NET MVC 3, it seems more logical to be inside the new Asp.Net MVC 3 project dialog box.

enter image description here

Any ideas?

+6
source share
3 answers

After some digging and โ€œreflectionโ€, I got a template to successfully display in the dialog box. Most credits relate to this post: Add a custom view in the dialog box of a new project?

The key to its work on my machine (64-bit) was the registry path mentioned in the response in this message. I also found that through Reflector there is a SupportsHTML5 key if you need it.

Here is a screenshot of my template: enter image description here

and here are the registry keys (there is also a name and description on MyOwnTemplate node)

enter image description here

+3
source

If you look at the template directory for Visual Studio and look at the template:

MvcWebApplicationProjectTemplatev3.0.cs.zip

(VS Install dir) \ Common7 \ IDE \ ProjectTemplates \ CSharp \ Web \ 1033

In this article, we will consider the following line:

<WizardExtension> <Assembly>Microsoft.VisualStudio.Web.Mvc.3.0, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Assembly> <FullClassName>Microsoft.VisualStudio.Web.Mvc.UserInterface.MvcTemplateWizard</FullClassName> </WizardExtension> 

So, they have a special master working here. these questions look the same:
Blank Asp.net MVC Template
How to write a MVC3 project template that will offer Razor or .aspx options

Basically, they say that the wizard is not open source, but you could write your own wizard.

EDIT:
Here are a couple of pages that will tell you how to create your own wizard:
http://msdn.microsoft.com/en-us/library/ms185301.aspx
http://www.codeproject.com/KB/system/create_VS_wizard.aspx

+2
source

I just wrote a blog post that explains how to do this and provides an example of a zip file and a batch file.

http://haacked.com/archive/2011/06/06/creating-a-custom-asp-net-mvc-project-template.aspx

+2
source

Source: https://habr.com/ru/post/889100/


All Articles