Manually download missing package for visual studio - visual-studio

When installing visual studio if we already have deleted content of C:\ProgramData\Package Cache directory then whole setup process will be turned into a real nightmare constantly complaining about missing packages. I've searched the web for a solution and the only working one I've found is a tool called install and uninstall troubleshooter.but the problem with it is i have to interrupt setup process and use this tool to remove the package and then get back to setup again which is really cumbersome job to do.
But the good thing is for every package that visual studio fails to uninstall it logs a GUID like this {A2999714-5C2C-3729-A911-4AE198B7B2FD} in the log file.Now better and ideal solution in my mind is looking after an official website from which i be able to download each of these packages by these GUIDEs.Is there such a location in the web? or is there any better solution to solve the issue?

Why did you delete the Package Cache? Do you have little disk space? The Visual Studio installer is so complex that you are fighting windmills trying to fix this I think. Perhaps they have an uninstall tool of some kind that will clean the slate.
Is this Visual Studio 2017? If so, maybe try these links:
Remove Visual Studio
Cleaning up corrupt Visual Studio instances
I doubt it will work since you have deleted the package cache. Note that most MSI-based installers should be able to uninstall without the package cache due to the cached MSI file in the super hidden folder %SystemRoot%\Installer.
Whatever you do do not delete anything from %SystemRoot%\Installer. Then you are in a totally unrecoverable state since this is an internal Windows Installer implementation detail. Do not mess around in here unless you know exactly what you are doing.
The files in %SystemRoot%\Installer are used to uninstall from the Add / Remove Programs Applet.
Further Links:
Visual Studio 2017 Broken and Cannot Uninstall or Repair

have deleted content of C:\ProgramData\Package Cache directory then whole setup process will be turned into a real nightmare constantly complaining about missing packages
Had the same issue, but with vcredist files, couldn't install any drivers without running into errors and eventually couldn't install because install failed.
I found the solution elsewhere. It said to
Fix problems that block programs from being installed or removed
https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed
download troubleshooter button on the link.
Run it - choose option - have problem with installing - it lists programs - choose the missing / problematic visual c++ runtimes in the list
it will run and get fixed.
Repeat for each visual c++ you having problems with. I ran the program multiple times.

Related

Error when rebuild the setup project in c#

Im getting below error when im going to rebuild my setup project in visual studio 2015.Please advice to resolve this:
The message means that the install of Visual Studio 2010 Shell (Integrated) is broken, so Windows is attempting to repair it. Also, it looks like it was installed from the internet, which resulted in the setup being performed from a temp folder that has since been deleted. It is always better to download the setup (such as the MSI file) and save it somewhere. It is also possible that the C:\Windows\installer folder has been damaged or has had files deleted because normally the repair would be performed from there, which might have been happening for a long time but you wouldn't have noticed until the cached MSI file was removed from /windows/installer.
The fix is to get hold of the exact same MSI file that was used to install VS 2010 Shell MSI file and save it somewhere, and browse to it when this happens again.
The cause might be a conflict between VS 2010 and VS 2015, or some removed or changed shared files. The application event log will have an MsiInstaller entry that says what is missing.

Visual Studio Major Issues

A few days ago now I tried to install the C++ packages for my VS2015 installation, but it wouldn't install them so I uninstalled the entirety of VS2015 and then reinstalled, but since then I've been getting tons of errors when I start the software, they are like this:
The 'Visual Studio Component Enumerator Package' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file: 'C:Users\\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
I've attached this log at the bottom of this post.
I get around 10 of these Package errors before I can finally load into the software, but then when I try to either open an existing C# project it says "Unavailable" or if I try to start a new C++ project it says
'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCWizards\default.vcxproj' cannot be opened because its project type (.vcxproj) is not supported by this version of the application. To open it, please use a version that support this type
I have tried the following to fix these issues, and every possible combination of these:
Uninstalling and reinstalling
Deleting my %appdata% in both Local and Roaming for VS 14.0
Deleting Program Files (x86)\Visual Studio 14.0
Repairing the installation
Uninstalling, cleaning registry, deleting everything I can find RE: Visual Studio and then reinstalling
devenv /setup, devenv /clearcache, devenv /uninstall /force and then reinstalling, every command line I've found anywhere.
I've been dealing with this issue for a few days and it has completely halted my development process and I'm unable to do anything with VS and it's gotten to the point where I'm extremely frustrated and not sure what to do next.
As far as I can tell there are a lot of packages missing from my installation, but Repairing my installation does not fix this. Is there a way to restore the packages?
Any assistance would be much appreciated, or is there a better forum to post this under?
Activity Log:
http://pastebin.com/pwTJQc4B

Why do I get an error for "__CrtGetFileInformationByHandleEx " when I try to compile

I just installed Visual Studio 2015 Community on my computer. Until now I have been using Visual Studio 2010 Professional. Now when I try to run my MVC apps in the build in web server, I get the following error message.
The procedure entry point __CrtGetFileInformationByHandleEx could not be located in \WINDOWS\SYSTEM32\msvcp120_clr0400.dll
I get the same error message if I try to execute vbc.exe (the Visual Basic compiler) on directly at the command prompt. My MVC app also shows a YSOD with
Compilation Error - Compiler Error Message: The compiler failed with error code -1073741511.
How can I fix my VS so I can run my programs again?!
Steps I've tried
Uninstall VS 2015 Community
Uninstall and reinstall .NET 4.6 and .NET 4.5.2
DISM /Online /Cleanup-Image /RestoreHealth
The .NET Repair Tool
Run sfc /scannow
Manually rename the msvcr120_clr0400.dll file to msvcr120_clr0400.dll.corrupt and do 1-5
Uninstall and reinstall VS 2010 w/ SP1
sfc /scannow successfully replaced the msvcr120_clr0400.dll file, but it replaced it with the exact same CTP file as before!
EDIT:
The problem dll's from my system are available for download here:
32 bit
64 bit
32 bit msvcr
64 bit msvcr
Microsoft is aware of this issue with KB3098779 and 3097997:
https://support.microsoft.com/en-us/kb/3118750
The recommendation is to uninstall these patches and then rescan for updates. Newer versions of these security patches (that do not break the VB compiler) are now available.
Okay, I see it from the files you uploaded to the sharing service, your .NET install is corrupted. A standard DLL Hell problem, your c:\windows\syswow64\msvcr120_clr400.dll file is the wrong version. Something you can see when you use Explorer and navigate to the file. Right-click and select Properties, look at the Details tab.
Note the word "CTP" in the Product name, means "Community Technology Preview". A Microsoft term that means "beta version". Clearly you should not be having the VS2013 beta on your machine. Your msvcp120_clr0400.dll is correct, it is file version 12.0.52512.0. It depends on an exported function in the msvcr DLL that the CTP version did not yet have.
Exactly how this happened is always hard to reverse-engineer. You are the 3rd SO user that I know of that had this problem this week, a bit too much of a coincidence. Two basic scenarios, if you ever had the VS2013 CTP edition installed on the machine then the problem is that it didn't get updated like it should have. Otherwise a very typical problem with CTP editions, they are pretty dangerous because the uninstaller is always the last thing Microsoft gets right. And the problem was just never detected until you started using a program that required this export.
Or it was caused by a rogue installer, copying the old version onto your machine without checking the version number. Much less likely, installers never have a good reason to install this particular file since it is only ever used by the .NET Framework. My money is therefore on your machine getting corrupted by the CTP.
You need to solve this by getting your machine fixed. Not that easy, you can never be sure how many other bad DLLs are lying around from such a bad CTP uninstall. A shortcut is copying this particular DLL from a good machine. But best to get .NET 4.6 re-installed.
EDIT from OP:
This answer correctly identified the problem files but reinstalling (or any other common steps) didn't solve it. In the end I copied "good" files from another computer with the version number 12.0.20806.33440.
KB3098779 appears to be the culprit on our server. That is the patch that installed the rogue CTP msvcr120_clr0400.dll mentioned in the above answer.
Solution: we reversed out the patch set that applied KB3098779, and everything is working again.
FYI: this is a .NET framework 4+ issue, not Visual Studio. Our server is a standard 2012 IIS server: Visual Studio is not installed.
I had the same issue on Windows 8.1 although KB3098779 and 3097997 were not installed on my machine. Probably it happened after installation of ASP.Net 5.
The issue was that I had both mcvcr files in version 12.0.51670.34230 while mcvcp files were already in 12.00.52512.0. It was enough to copy both mcvcr files (from System32 and SysWOW64) in this version from my colleague's pc.
If you have problems with permissions set to TrustedInstaller on these file, you can run this powershell command and then change permissions as Administrator:
takeown /A /F C:\windows\syswow64\msvcr120_clr0400.dll
Microsoft have issued a notice on this.
https://support.microsoft.com/en-us/kb/3118750
As others have pointed out too many people in too short a time to be a coincidence. Not a VS issue, this is to do with a bad update from Microsoft.
The info from MS mentions two security patches (KB3098779 and KB3097997).
I have uninstalled only KB3098779 and my site is up was up and running. It required a machine restart to complete
KB3097997 uninstalled without a restart. I maybe didn't need to uninstall but seems sensible given it is also subject to the same notice from MS.

Purge visual studio from system manually

So I thought I'd save myself some time in moving my visual studio installation from an old drive to my C-drive. Turns out this was a very bad idea.
I ended up trying the installers to clean up some of the mess, but they won't work, since they can't find all the files they're supposed to remove. This led me to manually delete the 'Visual studio 1x.0'-folders in an attempt to have the installers show 'Install' versus 'Modify', 'Repair' and 'Uninstall'. Now I've tried to do what support suggests on this page, https://support.microsoft.com/en-us/kb/248697, but no luck...
How can I get the installers to... install.. rather than 'Modify', 'Repair' and 'Uninstall', which they won't do anyway, since some (or most) files are missing?
Suggestions appreciated.
I just want the installer to install on C-drive, and possibly overwrite any remaining trash, be it files or configurations.
Software uninstallers sometimes fail to clean up completely. In those instances, a product like Revo Uninstaller should be able to clean up any remaining files and/or registry entries. It scans for any “leftovers” from a standard uninstaller and gives you the opportunity to selectively remove those objects that are preventing you from reinstalling.

Visual Studio hangs constantly during build

Probably between 25 and 50% of the times I build my solution, I see this:
"The operation you requested is taking longer than expected to complete. This dialog will close when the action completes."
I hate this window in ways I can't describe. It never resolves, the Cancel button is never enabled, and the only way to remedy it is to kill the devenv process and load up my entire solution again, knowing full well that I've fixed nothing and I'm equally liable to see the same thing when I attempt my build.
My solution is about 60 projects in total, which are mostly C# class libraries, with a few each of web applications, web services, and console applications. However, the problem persists even when building one slice of the codebase with the majority (50) of the projects unloaded.
My problem is that the output windows doesn't tell me anything at the point at which it freezes, and I don't know how else to determine the cause of this lockup. If I were to guess, I would assume that it's a deadlock in the filesystem or something, but I don't know how to go about proving this--much less how to prevent it.
What can I do to diagnose and eliminate this from my solution so that I never see it again? In general, how can I diagnose problems that occur during a build?
Had a similar issue, VS would hang for 45 or so seconds then build for 4 seconds and complete. The 45 seconds of hang would not produce any output to GUI and VS would hang.
Using ProcMon I could see 3 million+ file operations on the /packages/ folder via devenv.exe when I would build this project (and would continue for some time after)!! The first steps of the build you can see that it was checking EVERY PACKAGE to see if it needed to do a package restore (it did not).
Since I tend to blame NuGet for everything, I disabled NuGet Package Restore "allow NuGet to download missing packages" checkbox under Visual Studio -> Options -> Nuget Package Manager -> General. To my delight, the build was very fast. 5 seconds total!
Turns out that we had enable package restore on build enabled (I think this is on by default now in VS) AND we also had the packages checked into source control. It seems this causes TFS to thrash in some way... Checking for restoring packages must trigger TFS to do some source control operation checks.
FYI this was VS2013 UPDATE 4 - Nuget version: 2.8.50926.663, on a sln with NumberOfProjects = 38, but I could recreate this hang just building a single csproj with 2 dependencies.
Update:
Localhost "Rebuild All" on Sln with SccNumberOfProjects = 53 was taking 7:05 with 2 minutes of visual studio frozen / unresponsive
down to 4:14 on a 2 core i5 with no freezing
down to 2:44 on a 4 core i7
Also: This was on a machine with various file watcher security tools, likely not adding any speed to this whole process... and possibly to blame.
Update in 2021:
If you are looking for a paradigm shift, the new SDK style csproj format (see migration tool) + nuget PackageReference makes updates almost instant (< 20 SECONDS for same projects in scenarios above) - highly recommend you upgrade any legacy projects.
** Known incompatibility - website package references do not support static file references via nuget ( checkout LibMan)
I have seen this happen on large projects when MSBuild is running with the diagnostic switch turned on. In Visual Studio, go to Tools / Options / Projects & Solutions / Build And Run, then check the MSBuild project build output verbosity value. If its not set to Minimal, try setting to minimal and see if your builds are able to complete.
I did not try any of the above solution as by the time I tried my approach - all was well again.
My steps are as following:
Close VS
Delete the .vs folder
Open my solution
Clean Solution OK
Build Solution OK
Optional Rebuild OK
In my case setting "maximum number of parallel project builds" to 1 kinda helped (i.e. building a project from clean state causes 1 min freeze followed by normal build and every subsequent build works fine).
Aforementioned setting can be set in Tool -> Options -> Projects and Solutions -> Build and Run.
Seems like running Visual Studio as Administrator solved the problem for me! (For always running a program as Administrator see How to Run Visual Studio as Administrator by default)
I've found Visual Studio hanging a lot on building larger projects. Turns out it was ReSharper. After I turned it off: Tools -> Options -> ReSharper -> Suspend Now, everything built fine no issues (even on very large solutions, 100+ projects)
There was a suggestion on Microsoft Connect that Modelling project was responsible for the freezes. I removed a Modelling project from our solution and have experienced no freeze since then (about a week).
For me it was something to do with npm package install that ran automatically. I went to Tools > Options > Project and Solutions > External Web Tools and unchecked all external tools and restarted VS. After that, I was able to build it again. I know I need them to be checked but I need to figure out what's triggering them and what's wrong with this solution file.
VS2019 exhibits this issue as well for me, in my case, the problem was because of dependencies stored on a network share. I have a hunch that Windows Defender Antivirus was scanning a lot of extra stuff that was in the network share, which is only accessible when connected to a fairly slow VPN.
For me the issue was witch an extension that automatically runs T4 templates on build (AutoT4). Disabling it when working with solutions with EF fixed the issue.
I moved my VS 2008 development platform from Windows 7 to Windows 10 and encountered a situation where Visual Studio would hang up every time I tried to build a large project. I had to build the project, then use the Task Manager to kill VS and then restart. Needless to say, this made debugging really difficult! Anyhow, the problem was that in moving to Win 10, VS was no longer running as administrator (and perhaps Win 10 is more particular about privileges). Changing the properties so that the program ran as administrator resolved the problem. (IngoB -- I don't have enough status to comment on your post, but thanks for pointing this out!)
Just try below command with admin mode. Before running this command make sure to close all VS instance.
devenv /resetuserdata
Note: devenv is located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
In addition to the felickz's answer which solves (or almost solves) this problem for builds:
Except the problem during a build I also had problem with the Package Management Console. It took about a minute to wait for it. Using the procmon I found that the NuGet repository folder was parsed each time this window is opened (very smart, Microsoft!). There were about 1000 packages in this folder. After removing everything from the above folder the performance problem diapered.
Note that my answer relates to the VS 2015 (and may be below). I didn't tested, but suspect in VS 2017 it should be ok.
Visual Studio 2017
Removing Anaconda3 from the installation fixed it. In procmon I saw hundreds of thousands of calls looking for files in the Anaconda3 folder from hundreds of instances of powershell spawned by msbuild.
I had this problem because of an issue restoring nuget packages. There was a duplicate entry in the packages.config file. Rather than report it as an error, the build would just hang forever.
I didn't discover the problem until I tried to restore the nuget package through the "Manage Nuget Packages..." option in the menu. After removing the duplicate, the build completes properly.

Resources