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?
Related
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.
I made a simple project with Visual Studio, but when I try to run it, Visual studio freezes and I have to shut it down. If I launch the executable directly with the explorer, the explorer freezes. I've tried with visual studio 2010, 2013 and 2015, it always freezes.
Dependancy walker find no errors in it. I've sent it to a friend, and he manages to launch it on its computer. I've also tried to run in as administrator, still nothing.
I've tried this on several projects, even some of them that worked years ago, but I still have the problem.
My OS is Windows 10, with the Threshold 2 update.
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.
I have some web projects that run fine in the debugger in VS 2012. But when I try to run the same projects in VS 2013 i run into some problems.
First the whole Devenv.exe crashed when pressing F5.
I found an article about this problem here
It suggests set ISS Express in Visual Studio to 64 bit.
That solved the problem of the whole IDE crashing.
However, with that configuration Visual Studio tries to start "Remote Debugging". Probably because Visual Studio itself is 32 bit, so it must use some "remote" techniques to debug something 64 bit. At least that's my guess on what is happening.
Remote debugging is not succeeding either. I get "Remote Debugger has stopped Working" sometimes. Sometime at the beginning of the degugging session, and sometime at the end of the session. I found an article about this problem too. It suggest to set the web project to x86 to avoid remote debugging. But that will not work in this case. It has to run 64 bit to work with IIS in 64 bit.
Error message is
Remote Debugger has stopped Working
Then
The debugger's worker process (msvsmon.exe) unexpectedly exited. Debugging will be aborted.
Anyone else seen this?
Is this a common problem in Visual Studio 2013?
EDIT: more details about the environment
I have a solution containing several projects, including two web projects.
The issue happens when I try to run any of the web projects in debugger (by pressing F5).
They are normal web projects, and I am not running anything remote.
Visual Studio itself came up with the idea of using "Remote Debugger" when I checked the "Use the 64 bit version of IIS Express for web sites and projects".
The solution was first created on a Windows 7 machine running Visual Studio 2012 and it worked well there.
When I tried to open the same solution on a new machine running Windows 8.1 and Visual Studio 2013 the problem started.
A colleague is also running the same solution on his Windows 8.1. We share the solution using a git repository.
He has both VS 2102 and VS 2013 installed. He experiences the same problems in VS 2013, so he has started to use VS 2012 for this solution.
It runs fine in VS 2012. It is the same solution and same machine as it fails in VS 2013.
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.