Tuesday, August 9, 2011

Add Controller Menu Missing From VS2010 Context Menu

Normally in VS2010, when you right-click on the ‘Controllers’ folder, you will get a menu that includes 'Add/Controller’.  If this menu option is gone, it is because the project type is not setup correctly. 

To fix this:

  • Create a new blank MVC project.  Save and close the project.
  • Open up the csproj file in Notepad.
  • Copy the <ProjectTypeGuids> attribute.
  • Open up the csproj file you want to fix. 
  • Replace the <ProjectTypeGuids> attribute with the one you copied from the other file.

2 comments:

  1. Brilliant. I can stop banging my head now! Thank you !

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete