Reinstall Microsoft Visual Studio Asp.net MVC 5 Scaffolding extension - asp.net-mvc

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.

Related

How to solve rzc generate exited code 1 error

When i pulled code from team explorer in visual studio code . Rzc generate exited code 1 error occured. I am unable to build project.how to solve this error?
Target framework .net core 3.1
Open the Project in visual studio-> check in views folder for any files having X - red color symbol then remove that file from visual studio.
Previously you deleted the files from folder - that is the issue.
ie, Razor Engine trying to render those files, but the engine could not find the physical location of that file, that is the problem. Always delete the unwanted files using the visual studio or any project editor. That is the best practice.
I solved rzc generate exited with code 1 microsoft.net.sdk.razor.codegeneration.targets
by undoing the changes that deleted a project from the folder in file explorer instead of visual studio.
In your Project.csproj, you should have a piece of XML code like this:
<ItemGroup>
<Folder Include="Controllers\" />
<Folder Include="Views\Home\" />
<Folder Include="Views\Shared\" />
</ItemGroup>
It depends on your folder structure.
In case you are using Windows 7 and getting the 'rzc generate exited with code -2147450750' while debugging a .NET Core app, try installing the standalone package: Microsoft Update Catalog - KB4457144.
I had the exact same error message (apart from the directories) on Windows 7 with a newer VC++ distribution already present.
The package contains the KB2533623 that we want. Details of KB4457144: September 11, 2018—KB4457144 (Monthly Rollup)
After installation and a reboot, dotnet new console goes through without an error.
Dell forum source: Microsoft Windows 7 Update KB2533623 needed to install Dell Update Package (DUP)
You are using visual studio 2019 older version then you have updated to the latest version has fixed my issue.
Yes. I have delete some files manually from folder.
So i resolved that issue by deleting the unloaded files from that deleted folder as
red cross files will be still in our visual studio if we delete
them outside.

NullReferenceException when installing any Extension in VS2019

I got the exact same problem posted here:
Attempting to Install an extension to VS2019 results in a NullReferenceException
Same error, same log.
But since I cannot comment nor answer and the question has not been answered as of yet, I'm asking again.
I am using VS2019 Community, but I had VS2017 Enterprise at one point. (student license)
Every single extension I tried to install so far has led to this error. For example "Live Share", "Open Command Line", "Github Extension for Visual Studio", "Markdown Editor".
I believe it started with Live Share when suddenly an update wouldn't install for no reason. I guess that was back with VS2017 even. But I cannot recall, I just assume. With the newly installed VS2019 I was never able to install any extension via the in-app Extension feature, nor by downloading with browser and then trying to open it.
What I've tried:
0) Every suggestion by Perry Qian-MSFT
1) Repairing Visual Studio 2019
2) Reinstalling Visual Studio 2019
3) Uninstalling "Live Share"
4) Deleting various Folders or contents thereof:
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio
C:\Program Files (x86)\Microsoft Visual Studio\2017 (trying to get rid of any remnants)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions
Next I'll deinstall as much as possible: VS2019 and Installer and try to see what's left, what could have remained that causes such pain in the a***.
But since my internet will be busy with reinstalling afterwards for a while this question goes up now.
Update1: The installer made some problems getting uninstalled. Deinstallation via Windows Software Management failed with an error but it was still removed from the list. Now I've deleted the folder and will try and reinstall the installer. I don't know why I didn't try that before throwing it all over board.
Update2: I decided to start with a simple barebones VS2019 version without any workloads. But it still doesn't work. So back to throwing everything out and looking for the remainder.
Update3: I now tried to delete various folders then reboot and tried to reinstall a barebone VS 2019 Community again. Still same error.
Here's a list:
C:\Program Files (x86)\Microsoft Visual Studio Tools for Unity
C:\Program Files (x86)\NuGet
C:\Program Files (x86)\MSBuild (except for .\Microsoft\Windows Workflow Foundation)
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio Services
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio\Packages
C:\Users\Admin\AppData\Roaming\Microsoft\Microsoft Visual Studio
C:\Users\Admin\AppData\Roaming\Microsoft\VisualStudio
C:\Users\Admin\AppData\Roaming\Visual Studio Setup
C:\Users\Admin\AppData\Roaming\vs_installershell
C:\Users\Admin\AppData\Roaming\vs-report-problem
C:\Users\Admin\Documents\Visual Studio 2013
C:\Users\Admin\Documents\Visual Studio 2017
C:\Users\Admin\Documents\Visual Studio 2019
Oddly enough my personal settings are still persistent. So these will be my next target. But where are they stored? Any pointers?
Update4: Seems like settings are stored in a cloud, hm. I made a local backup and tried to reset them resulting in yet another error.
Your settings were reset, but there were some errors.
Error 1: An error occurred while importing settings for 'Product Updates' [code 5396].
Was this 'Product Updates' Setting the culprit?
Update5: The settings reset didn't seem to accomplish anything at all.
Update6: So, I've signed out of VS, reinstalled VS2019 again and this time it seems like settings were actually reset. Still no luck. This is getting really frustrating.
That's it. I'm done. Apart from reinstalling Windows 10 I have no clue what could help now. Maybe there was some registry error? I am lost here.
Thanks to #dxiv who made me aware of the InstallCleanup.exe.
I don't know what that tool does additionally to what I did and I cannot tell what was wrong in the first place. But that thing actually helped!
Thanks again!

Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found

I have migrated a VS2008 solution to VS2013. My solution contains VC++ projets.
I have set the tools platform to v120_xp for each project
My solution compile on my computer and compile on my builds server in VS2013
My builds server is a Windows2008 R2 with VS2008, VS2010 and VS2013 and a build controler of TeamFoundationServer 2010.
When i launch the build with the build controller, the build fails with :
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
In the V110 directory this file doesn't exist but it exist in the V120 directory.
I have checked the registry :
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersion\12.0
the VCTargetPath are corrects
Have you an idea to help me?
I have edited the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0\11.0
to use the V120 directory
Now my server build the solution, but i don't understand why MSBuild use the key
ToolsVersions\12.0\11.0 and not the key ToolsVersions\12.0\12.0
Parhaps it's due to the v120_xp platform toolset
The true answer is that MSBuild subtracts 1 from the .sln Visual Studio Version. Since you do not have VS 2012 install or you have not installed it, the v11.0 folder is not found. It is all explained by Sayed Ibrahim Hashimi:
http://sedodream.com/PermaLink%2cguid%2ca5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx
I came across the same problem in 2015 though, with Windows 10 and Visual Studio 2015 RC (fresh install)
To correct the issue I tried several solutions based on my research ie installing "VS Windows SDK" which didn't do anything different to resolve my problem, I then on another recommendation installed GitHub in order to download MSBuild which is now excluded from VS, I ultimately downloaded and installed "VS Tools for Windows 10" this didn't give me the same error in the end, without having to change registry keys
Installing VS 2012 on your build server should create the necessary targets files for you.
I was able to get past this by changing $(VCTargetsPath) to $(VCTargetsPath12) in the project file.
This feels like a temporary workaround rather than a permanent solution, since once we move to the next version of Visual Studio we'll have to find all the references to $(VCTargetsPath12) and replace with the new target path.

ASP.NET MVC 4 Visual Studio 2010 project templates not present

I have downloaded and installed all of the prerequisites for using MVC 4 with VS2010. The VS2010 SP1 update, ASP.NET MVC 4 for VS2010, SSDT for VS2010, and LocalDB. When I go to create a new website in VS2010, there should be an "ASP.NET MVC 4 Web Application" template, but there is not. How can I get the templates so I can start a new MVC 4 website in Visual Studio 2010?
Have you tried reinstalling the templates. Follow these directions.
http://msdn.microsoft.com/en-us/library/vstudio/ms247116(v=vs.100).aspx
short answer, open up visual studio command prompt and type:
devenv /installvstemplates
That should restore all your templates.
Check if Project Templates are installed:
Manually search if you find the project template (it would be *.zip) inside %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Web\1033
If YES, please run devenv.exe /installvstemplates
If NO, then its guaranteed that the ProjectTemplates are not installed. You would have to reinstall to get the ProjectTemplates on your disk.
For the records:
All the installed project templates are available here: (this is the default path)
%ProgramFiles%\Microsoft Visual Studio
10.0\Common7\IDE\ProjectTemplates
This is where the File->New ->Project Dialog loads ProjectTemplates from, and is displayed in the Same Folder heirarchy convention.
You could add another path by updating
Tools -> Options -> Projects and Solutions -> General -> User Project
Template Location
On studio(devenv.exe) launch/loading it would try to create a ProjectTemplateCache on localappdata or %ProgramFiles% based on whether you are local user or admin.
The cache inside Programfiles are available here
%ProgramFiles%\Microsoft Visual Studio
10.0\Common7\IDE\ProjectTemplatesCache
This ProjectTemplateCache directory is Created (if doesnt exists) or Updated(if already exists) by running *devenv.exe /installvstemplates on cmd. This command is run during installation of Visual Studio. Ideally all other installers who ship project templates should run this command. But, sometimes this might fail due to access rights. So its is safe to run it again manually.
See this question
If you didn't install the Visual Web Developer component, the ASP.NET
project templates won't be fully installed. Naturally, because the
installer then thinks it doesn't need to put them there as ASP.NET is
a web development framework.
1) Install it as Administrator. right click on file and run it as Administrator.
2) Uninstall it and Install it as administrator again could solve your problem
If the install went through fine without errors/warnings/exceptions -
Try changing the .NET framework on the New Project window, make sure you are viewing .NET framework 4.0 templates.
PL
Repair MVC 4 installation. It will take care of project template installation
Same as me.
make sure register and activation vs2010 product.if vs not register and not type any key for activation vs You can not ins mvc4 for it.
Please register vs2010 and re-install mvc4.then you can see mvc4 when you create project.

Azure and the MVC2 Web Role template

I tried creating a Cloud project in VS2010. When I try to add the ASP.NET MVC2 Web Role template and click okay then I get the following message appear in a dialog box.
The project template references by the roletemplatedata.xml file cannot be found
I tried a remove and reinstall of the 1.3 SDK but that didn't help. I tried a reinstall of the MVC2 tools but that didn't help. I wish VS2010 gave a bit more information. There are many roletemplatedata.xml files and it doesn't give me a clue as to what is missing.
Anyone else have a similar problem?
Go to Add/Remove Programs and add Visual Web Developer feature (if it's not installed) to the VS Setup. If it is already installed then uninstall this feature once and reinstall again.
Please check if the following blog entry helps you:
http://blogs.msdn.com/b/avkashchauhan/archive/2011/05/15/creating-mvc-2-web-role-in-visual-studio-2010-cause-error-quot-the-project-template-referenced-by-the-roletemplatedata-xml-file-cannot-be-found-quot.aspx
What do you have here:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CloudService
Execute:
tree /F "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CloudService"

Resources