Visual Studio 2022 build takes forever - nuget-package-restore

Visual Studio 2022 build takes forever and the same project works fine with Visual Studio 2019 on the same machine
On build, got NuGet package restore error:
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Error occurred while restoring NuGet packages: The operation failed as details for project API.Tests could not be loaded.
Tried clearing packages cache, resetting settings, deleting .vs folder & also clearing %temp% prefetch

Fortunately, it is now fixed in the latest Visual Studio 17.5.0 Preview 6.0
https://visualstudio.microsoft.com/vs/preview/
There is an alternative in this answer, but while it helps when using command line, it is still very annoying for anything inside Visual Studio 2022. I am hitting it on many scenarios, like trying to run tests after build was successful.
VIsual Studio 2022 stuck on Restoring Nuget packages

Related

Error updating Visual Studio 2017 15.6.2

I was trying to update VS 2017 to 15.6.2 version. As usual VS asked me to update the Installer. But the Installer updating failed and now, when I try to launch the VS updating again, I get this error message:
Error loading vs_installershell.exe: No signature was present in the subject.
Anyone has ever seen this before? Any help will be appreciated.
Microsoft recommends the following procedure in this case:
Close the Visual Studio Installer.
Delete the Visual Studio Installer directory. Typically, the directory is C:\Program Files (x86)\Microsoft Visual Studio\Installer.
Run the Visual Studio Installer bootstrapper. You may find the bootstrapper in your Downloads folder with a file name that follows a vs_[Visual Studio edition]__*.exe pattern. If you don't find that application, you can download the bootstrapper by going to the Visual Studio downloads page and clicking Download for your edition of Visual Studio. Run the executable to reset your installation metadata.
Try to install or update Visual Studio again. If the Installer continues to fail, go to the next step.
There is also a bit of warning:
Performing the following actions reinstalls the Visual Studio Installer files and resets the installation metadata.
But in the end, it reinstalls the VS Updater.
Source: https://learn.microsoft.com/en-us/visualstudio/install/troubleshooting-installation-issues

Visual Studio 2015 Initializing Part Nuget.PackageManagement.VisualStudio.VSolutionManager must be called on UI Thread

While attempting to build or open a project in Visual Studio 2015 14.0.25431.01 Update 3 which I recently updated, I keep getting errors around nuget package management. Whenever I build the project the first time after opening VS, I get the error message below. I also get it when I try to open the nuget package manager dialog. Anyone else experience this?
An exception was thrown while initializing part
"Nuget.PackageManagement.VisualStudio.VSolutionManager".
GetFullVsVersionString must be called on the UI thread.
I had the exact same issue as you and I was able to get NuGet to work again for me by doing the following simple steps.
Completely close all versions and windows of Visual Studio
Reopen a blank Visual Studio window
Navigate to Tools -> NuGet Package Manager -> Package Manager Settings
Press "OK"
Open the project you were having issues with
Try opening "Manage NuGet Packages..." or running your project
Your issue should now be fixed!
I had originally tried uninstalling NuGet and reinstalling it through the "Extensions and Updates" under "Tools" to no avail. The solution I listed above fixed it instantly.
It appears reinstalling Nuget Package Manager for Visual Studio in the Extensions & Tools dialog may have fixed it.
-First
Delete all cache on C:\Users\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
-Second
Reinstall Nuget package manager by Tools->Extensions and Updates. After that restart your visual studio
-Third
Go to Tools->Nuget Package Manager->Package Manager Settings of blank project (for create new cache), and after that, try on your project
I was getting this with a Visual Studio Extension from Telerik. Once I uninstalled it went away.
In VisualStudio 2015 -> Tools -> Extensions and updates -> Online: Search for the string: "Fix NuGet GetFullVsVersionString must be called on the UI thread"
and install the given fix.
Alternatively you can download the fix at :
GetFullVsVersionString fix
Now in February 2018, the latest NuGet Package Manager version 3.4.4.1321 does not have the fix included, so the patch must be applied.
As Steve Greene's answer describes, I also had the Telerik extension installed, so that might have caused the problem.
This problem can happen if you have Xamarin for Visual Studio installed. There is a NuGet bug reported about this.
If you have Xamarin component in one of your projects and then try to use NuGet then NuGet can be called on the wrong thread.
There is a separate Xamarin extension that can be installed to fix this problem with Xamarin for Visual Studio.
Run the Visual Studio as 'Run as administrator' mode.
If it does not work then, if you have other version of Visual Studio like 2013
then uninstall all and install again.
This is what worked for me (VisualStudio 2015):
Uninstalling NuGetPackageManager in Tools->Extensions and Updates.
Closing all open VisualStudio.
Deleting the cache on C:\Users\user\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
Restart PC
Install NuGetPackageManager in Tools->Extensions and Updates in a blank application or on the startup VisualStudio screen.
Close every VisualStudio again.
Finally it should work.
I had to follow this process or it did not work.

Working in Visual Studio Professional 2015 while updating to Update 3 - Visual Studio starts to fail

I got the Visual Studio Professional 2015 Update 3 and launched the executable (vs2015.3.exe) while Visual Studio was still running. I got the following "Setup warning" but thought that a computer restart was fine as long as I could work during the update.
Please close visual studio now to reduce the chance that a computer
restart will be required later
Visual Studio immediately started acting strange, loosing Intellisense among others. I decided to restart Visual Studio and was then met with the error:
Cannot run when setup is in progress
I then canceled the update and thought that I could install this update during the night instead. When I opened Visual Studio again and tried to load a project I got the following error:
Project '' could not be opened because the Visual C# 2015 compiler
could not be created. Please re-install Visual Studio.
I then opened Update 3 executable again to complete the update. I was met with this feature list and could not do anything:
Restarted the computer but was met with the same dialog. I then opened Visual Studio again and this time the project loaded but without Intellisense. Restarted Visual Studio and now the project would not load at all. I then deleted the content of these 2 folders and ran devenv /resetsettings
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\VisualStudio\
C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
I could now open the Visual Studio project normally again but I still could not get features when running the Update 3 executable. Is there anything else I can do or do I need to reinstall Visual Studio completely? I think it is really bad that the warning Microsoft gives is that a computer restart might be required when obviously the program cannot run in the background while updating.
Solved it by going to Control panel -> Programs and Features -> Microsoft Visual Studio Professional 2015 with Updates. Click "Change" and then select "Repair".

Team explorer 2015 View Builds generate Malformed Artifact URI error

I am having an issue with Team explorer in visual studio 2015 Update 1 RC.
The server is TFS 2013.
When I want to View Builds of a specific build, I have this error message
Malformed Artifact URI: [Build name]
Parameter name: uri
This is working using Visual studio 2013 on the same machine, and working with visual studio 2015 on other machine. So this is not a problem with the server.
Only 2 machines have the issue, and both have the extension TFS power tools 2015 installed.
I tried:
Remove the extension
Clear Team foundation cache
Repair visual studio
Hard reset all settings
Didn't resolve the issue.
"Edit build definition" and "Queue new build" are working.
Any ideas other than uninstall and reinstall visual studio?
Thanks
Edit:
- Creating a New build definition in VS2015 is working, but trying to open it doesn't work
I can reproduce your issue in my Visual Studio 2015 just after the Update1 RC is installed.
Here is my Visual Studio version:
I have reported this issue. You can also submit one feedback on the Microsoft Connect site.
Now, you need to open TFS web access directly to view one build. Or you need to uninstall Update1 RC.
This issue is fixed in VS2015 update1. You need to download and install it: https://www.visualstudio.com/en-us/news/vs2015-update1-vs.aspx
Cleaning cache folder on your client machine: C:\Users\username\AppData\Local\Microsoft\Team Foundation\6.0\Cache. And clean the cache on your TFS AT machine: C:\TfsData\ApplicationTier\_fileCache
Then, on your client machine, resetting settings and add-in settings with devenv /ResetSettings and devenv /ResetSkipPkgs, try rebuilding all templates with devenv /setup.

devenv.com hangs in VS 2013

When calling devenv.com from command line or FinalBuilder action within our automated build it sometimes hangs and never gets past compiling step.
It is called with this parameters from C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE:
devenv.com /build "Release|Any CPU" "D:\MyProject\MySolution.sln"
It hangs forever on this step. When I open it in VS 2013 and ReBuild the solution it works fine every time.
Any ideas? I've also tried it on other build machines and it does the same. So it is not machine dependent.
After a lot of troubleshooting and looking through various logs, solutions, googling, I figured out that this is caused by the Extension Manager in Visual Studio 2013.
You can find the extension manager in all Visual Studio version -> Tools -> Extensions and updates.
So by uninstalling the Nuget Package Manager from Visual Studio 2013, made it the solutions compile successfully every time.
Another fix we noticed and could reproduce every time is when our virtual machine in Hyper-V was given 2 CPUs, it would cause builds to hang every time. Reducing the VM to only have 1 CPU fixes the problem.
We have solved this by creating a new .sln and adding existing projects to it. NuGet info is now revomed from the .csproj files and we now use "nuget.exe restore" to update NuGet packages before a call to devenv.com. This has fixed it for some projects.

Resources