How to write a MVC3 project template that will offer Razor or .aspx options

I wrote two separate project templates for creating MVC3 projects (both based on the standard Microsoft template, but with additional controllers / views) - one with ASPX views and the other with Razor views.

But instead of having two separate templates, I would rather imitate how the Microsoft MVC3 template works, which offers both viewer options selected in the second dialog box. I know that this is done using the Wizard, but I cannot find the Wizard in the MVC source code (which I downloaded). Does anyone know where to find the Wizard, or are there any other useful suggestions? Thanks.

+1
source share
3 answers

The MVC New Project user dialog exists in Microsoft.VisualStudio.Web.Mvc.3.0.dll . We do not send source code for this assembly.

+1
source

I used the export template wizard to create my own ASP.NET MVC3 project template. This worked fine, but did not offer the same features that Microsoft ships with its Visual Studio MVC build. I also ran into a problem when strongly typed views were not updated with the correct namespace. They kept the namespace of my original design, while the controllers and model were correct.

We would like the source code to be available for MVC 3 project templates!

Here is the wizard I used. It will definitely come in handy. http://visualstudiogallery.msdn.microsoft.com/57320b20-34a2-42e4-b97e-e615c71aca24/

0
source

Phil Haack documented how to create a custom MVC3 project template that appears inside this wizard (as opposed to a regular project template that won't)

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

If you follow this process, you will only get a razor as a possible viewing mechanism. To get other viewing mechanisms, you need to expand the reg files to indicate a spark, etc. Details on this are given in this stack overflow answer:

Add custom view in the New Project dialog box?

0
source

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


All Articles