Asp.net-mvc – How to get the “Add Controller” and “Add View” menu options in the ASP.NET MVC project

asp.net-mvc

I added ASP.NET MVC manually to an existing WebForms application… thanks to
this tutorial.

However, now I do not have the menu options (When right-clicking on the Controllers folder or Views folders) to show the Add Controller or Add View dialog boxes. I do have this when creating a brand new MVC project. How can I get visual studio to realize I am using MVC in this mixed project?

Best Answer

Technically controllers are just .CS files that are put in the controllers folder and views are just .ASPX files that are put in the views folder. Your controllers classes need to inherit from the base Controller class and your ASPX page needs to inherit from System.Web.Mvc.ViewPage.

As far as getting those items in your menu though try opening your project file and replacing the projecttypeguids tag with this one.

<ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>