ASP.NET MVC - menus missing Add Controller and Scaffolded Item?
Working in Visual Studio 2013 Update 4, I recently had a need to create an ASP.NET MVC WebApi Controller. Normally, this is as simple as right-clicking the Controllers folder of your MVC web project, clicking Add, then clicking the Controller... menu option (as shown below):
That process becomes considerably more challenging when the Controller... menu item has disappeared (in this case, along with the New Scaffold Item) as well. So I tried to create the controller via Add -> New Item...
Unlike the picture shown above, I did not have the needed "Web API Controller Class (v2.1)". So the search was on to figure out how to get my web tooling extensions back. After several false starts - repairing VS2013, uninstalling and reinstalling VS2013 ( a few times in various ways), I finally found the following StackOverflow post: http://stackoverflow.com/questions/19835385/reinstall-microsoft-visual-studio-asp-net-mvc-5-scaffolding-extension. Hmm, now I had some things I could try.
I did the following:
- deleted the PendingDeletes entry under registry key HKEY_USERS\<SID>\Software\Microsoft\VisualStudio\12.0\ExtensionManager
- Navigated to C:\Users\mylogin\AppData\Local\Microsoft\VisualStudio\12.0 and deleted the 12.0 folder
- Navigated to C:\Users\mylogin\AppData\Roaming\Microsoft\VisualStudio\12.0 and deleted the 12.0 folder
- Downloaded the ISO (aka DVD) file for Visual Studio 2014 Ultimate with Update 4 from MSDN:
- Opened the ISO file and navigated to \packages\WPT, where there are two files of interest:
- I right-clicked each of these files in turn, and ran an Uninstall.
- I then right-clicked each of these files in turn, and ran the Install.
- I started up Visual Studio and voila! My ability to create controllers was back.
I wish I knew enough to say which of these steps were truly necessary and which were not. All I can say for sure is this process got me back in the business of being able to create controllers.
I deleted the "AppData\Local\Microsoft\VisualStudio\14.0" folder (for visual studio 2015) and it worked.
ReplyDelete