6

I upgraded my solution from MVC 4 to MVC 5 in Visual Studio 2012 using this tutorial. In the last step I removed the ProjectTypeGuid for MVC 4 from my .csproj file.

Now the problem is that I don't see Add Controller, Add View in Visual Studio when I want to create new Controllers/Views.

I read this answer for MVC 4 so I know I need to get the correct ProjectTypeGuid for MVC 5 in order to regain that functionality. I was wondering if anyone knows what that is so that I can add them to my .csproj file?

2
  • @SLaks that option is not there when I right click on the controllers folder. Commented Dec 9, 2013 at 19:54
  • See: stackoverflow.com/a/20397312/736079 Commented Dec 9, 2013 at 20:39

2 Answers 2

12

Install the following items:

  1. Visual Studio 2012 Update 4
  2. Web Tools 2013.1 for Visual Studio 2012 (Web Platform Installer | Direct Download)

Then follow this tutorial to upgrade your MVC 4 project to MVC 5.

Finally make sure your project has the following ProjectTypeGuids:

<ProjectTypeGuids>
    {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>

In MVC5 the option you're looking for might be hidden under the Add Scaffold menu option. See the release blog post for more information on MVC5 scaffolding.


Some information gathered from: http://forums.asp.net/t/1950055.aspx

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, this helped a lot. I will add another link that show some other steps that I had to do to make this work.
My Project file has these GUIDs, but I still don't have the option to add Controller/View. There is no Add Scaffold menu option either. No Controller/View templates appear in "Add New Item" menu.
I've been working on MVC5 for a while, but the shortcut keys and options for AddView keep disappearing on me :/
1

If you are still using Visual Studio 2012 and are looking for a way to have intellisense for your views made for razor 3, if you want to add a new view and a new controller with the proper menu entries in visual studio you probably noticed that with things don’t work as they should.

Simply install the following 2 components:

ASP.NET and Web Tools 2013.1 for Visual Studio 2012 (link to direct download) Entity Framework 6 Tools for Visual Studio 2012

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.