I have an existing WebForms project to which I'm adding MVC pages. I created an MVC project and copied the project type guids.
It works fine, but I can't get Visual Studio to display the "Add Controller" or "Add View" wizards on my controllers and views directories (they're not /Controllers
and /Views
, they're in /Foo/Controllers
and /Foo/Views
).
Is it possible to enable the wizards?
Here is the guid for MVC3 :
unload your project, open csproj file and add the GUID to the begining of tag. no extra spaces nor line breaks, then reload the project. Like this
For MVC 4:
To get full designer support for hybrid projects you need to add MVC "project type" to in the project file.
Open your project file and replace ProjectTypeGuids tag with
After that you will see new context menus ("Add View", "Add Area", "Add Controller", etc) in your "old" ASP.NET project
Works for both MVC and MVC 2.
For MVC 3, ProjectTypeGuids should look like the following:
(See Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3)
I've given up on this. Instead, I have some basic Resharper snippets. Too bad this isn't configurable.
Maybe you could enable them, but why bother? Those wizards are available just two clicks away: right click on the folder, click on Add - New item, then select "MVC View Page" or "MVC Controller Page". They are not in the contextual menu, but they are still quite near... :)