I hade a problem with scaffolding in Asp.Net MVC 5 and Visual studio 2013
I tried to reinstall the extension "Microsoft Visual Studio Asp.net MVC 5 Scaffolding" by first uninstalled it. But I cant find any way to install it again.
I tried to repair visual studio. - no luck
I tried to uninstall visual studio and install visual studio, but the extension is still missing
Do I have to reinstall the PC or is there a quick fix?
I wanted to add to Chrille's answer.
The PendingDeletes can be found in
HKEY_USERS\<SID>\Software\Microsoft\VisualStudio\12.0Exp\ExtensionManager
And
HKEY_USERS\<SID>\Software\Microsoft\VisualStudio\12.0\ExtensionManager
And I found the AppData in my local and Roaming app data.
Here's what I did. It was a bit more involved than what everyone else was reporting. I tried doing a repair in the Control Panel, it ran for several hours and then failed. Perhaps my problems were that I installed VS2013 sp1 and then upgraded it to SP4 before I removed "Microsoft Visual Studio Asp.net MVC 5 Scaffolding."
I downloaded and installed Visual Studio Premium with Update 4 and then did a repair using that file, but the extension was still missing. I then found the AspNetWebFrameworksTools_VS12_ENU.msi in the en_visual_studio_premium_2013_with_update_4_x86_dvd_5935086.iso and did an uninstall and a reinstall, but the extension was still missing.
I extracted the packages\WPT\AspNetWebFrameworksTools_VS12_ENU.msi file from my .iso file using msiexec. In order to get the .msi file to extract successfully, I also had to place the *.cab files from \packages\WPT into the same folder I was extracting the .msi from. Once I'd extracted my msi file, I went into it's folder structure and found the Scaffolding stuff. It was in Dest\Microsoft ASP.NET\ASP.NET Web Stack 5\VS_12_COMMON7_IDE\Extensions\Microsoft\Web\Mvc\Scaffolding folder.
Once I had that, I still didn't have a .vsix file that I could install into Visual Studio. So what I did was create my own .vsix file. I did a little research on the web and created a file called [Content_Types].xml, it's literally called that. I renamed the file extension on several .vsix files that I had downloaded on my system to .zip and looked inside them to see what the contents of my [Content_Types].xml should look like, here's what I came up with:
<?xml version="1.0" encoding="utf-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="dll" ContentType="application/octet-stream" />
<Default Extension="pkgdef" ContentType="text/plain" />
<Default Extension="vsixmanifest" ContentType="text/xml" />
<Default Extension="txt" ContentType="text/plain" />
</Types>
I then zipped up [Content_Types].xml, extension.vsixmanifest, and Microsoft.AspNet.Scaffolding.Mvc.5.0.dll to a zip file called Microsoft.AspNet.Scaffolding.Mvc.5.0.zip. I then renamed that .zip file to Microsoft.AspNet.Scaffolding.Mvc.5.0.vsix. I then was able to install the extension using this .vsix file that I created.
I found that uninstall the AspNetWebFrameworksTools_VS12_ENU.msi in the vs2013 ISO. And install it.
So here's what I did...
1) I uninstalled the scaffolding through Visual Studio.
2) Deleted the registry from:
HKEY_USERS\<SID>\Software\Microsoft\VisualStudio\12.0\ExtensionManager\PendingDeletes
3) Went to Control Panel > Programs
4) Select Microsoft Visual Studio Ultimate 2013 > Hit Change
5) Choose Repair.
Pretty simple, but a little time consuming
Fixed it by deleting pendling delete in the registy + deleted AppData for Visual studio
AppData will be recreated at startup of vs
- Have 7zip installed.
- Download the full iso of visual studio.
- extract the iso to a folder.
- Go to \packages\WPT within that folder.
- Run AspNetWebFrameworksTools_VS12_ENU.msi
- Uninstall.
- Run AspNetWebFrameworksTools_VS12_ENU.msi
- Install.
That should do it.
To verify, create a new MVC project, and try to add a scaffold item. Don't verify with an existing project, because that may be a whole different problem.
I was missing the MVC controllers in scaffolding (only able to select Web API 2), then after removing MVC 5 scaffolding to reinstall I could not get it installed again.
I found downloading the .iso for VS 2013 update 4, extracting to a folder, then running AspNetWebFrameworksTools_VS12_ENU.msi to uninstall, then again to reinstall, then rebooting resolved both issues. I am now able to add controller, and I have MVC 5 controllers to choose from.
What worked for me was to remove the Registry keys, the AppData and the folder in this location C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions
. After this, I repaired the VisualStudio from Programs and Features in control panel. I was desperate because even I uninstalled and re-installed again and the extension was not visible.