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.
Related
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
A few days ago Visual Studio 2015 started dying on me when compiling.
If the build is successful it takes forever to compile and Visual Studio hangs.
If the build fails Visual Studio kindly hangs and then I get a message saying the program has stopped:
This has never happened before and my work has been blocked for 3 days now.
I'm desperate. Any ideas?
Things I've tried:
Restart my computer (still dies)
Restart Visual Studio (still dies)
Build another project (still dies)
Deleting the .suo file in the solution (still dies)
Disabling ReSharper (still dies)
Removing ReSharper (still dies)
Resetting Visual Studio to its default settings (still dies)
Uninstalled and reinstalled Visual Studio 2015 (still dies)
Uninstalled and installed Visual Studio 2017 (still dies)
Run a memory check (Memory is OK. VS dies.)
Combining one or more of the above solutions (dies...)
Other teammates don't experience the problem. Same tools same projects.
Thanks in advance.
Edit 1:
Tried with a new, untouched, project as suggested by #Surreal.
Compiles successfully. I break the code on purpose and VS dies.
Tried manually running MSBuild on my solution from the command-line as suggested by #bsinky. Build fails with a strange error.
What is this "target go" thing? I looked it up on Google and can't seem to find anything related.
No idea how this was related but cleaning my Windows' temp folder along with the prefetch folder fixed the problem (I used CCleaner).
I did have to recompile and readd some broken references though.
But now I can compile both good code and bad code.
Since a couple of weeks, MSBuild doesn't finish any builds anymore when I try to build a Visual C++ project in Visual Studio 2010.
In Process Explorer I can see that a subprocess MSBuild.exe is attached to devenv.exe, but no cl.exe is ever invoked. After 30 seconds another MSBuild.exe subprocess is attached and this continues for a while, until finally the build is aborted (or I kill Visual Studio).
I observed that after killing Visual Studio, the MSBuild processes are orphaned and if I restart Visual Studio and invoke another build, it suddenly works.
When every orphaned MSBuild process has exited, I cannot build anymore.
I tried to check, if there's anything wrong with the MSBuild installations, but at first sight it looks fine.
I reinstalled the SP1 of VS 2010 as well as Windows SDK 8.1, but nothing changed.
I also installed VS 2015 Express, which now ships with MSBuild (previously was shipped with .Net Framework), but same behavior.
The problem occurrs with different Visual C++ projects.
I could not google any solution, for slightly related problems there seemed to be issues with Avast antivirus. This is a corporate notebook, which is protected by Sophos, so I can't change any antivirus settings.
EDIT1
If I invoke MSBuild directly with
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\MyProj\MyProj.vcxproj
it just works.
Any hints or suggestions?
Everything was working fine with my Visual Studio (Ultimate 2013) today until I came back from lunch and I started getting CPU spikes every time I switch between tabs within Visual Studio (Ultimate 2013). It especially appears to be happening when I switch between config files.
Using Process Monitor, I was able to determine that it was continually searching in the packages folder:
For the same things over and over again:
How do I keep VS from doing this?
Go to Tools --> Nuget Package Manager --> Manage Nuget Packages For Solution...
It will prompt that not all packages have been downloaded. Select that you'd like to download them.
Problem solved.
I'm using Visual C# 2010 Express RTM with Windows Phone Developer Tools April CTP Refresh and when I run any Build option, nothing happens. I've deleted the contents of the build output folders and that doesn't do anything. I can't even run the project, because it complains the executable is missing (XNA Game for Windows project). I've tried the project on another computer and it builds just fine. Any ideas?
I'm not sure how this happens, but here's how I fixed it:
Open Build -> Configuration Manager
In the "Platform" column, choose x86 instead of Any CPU
Click close
These exact steps may not work for you, but I've found that if you play around in the Configuration Manager window it will usually resolve this problem.
try a reinstall?
Visual Studio 2010 doesn't work with current versions of XNA Studio. You'll could wait until XNA Studio 4 comes out (apparently due this month).
To solve your issue, use Visual Studio 2008 or use the workaround at this link to continue using VS2010 and XNA.