Visual Studio Rebuild Solution hangs - visual-studio-2010

I have a solution that is composed of six assemblies. When I initially load the solution and try to build it, it seems that Visual studio just hangs. It says that it’s building, but I see no updates in the Output window. The CPU jump to 100% usage. The only thing I can do is to Cancel the build or to shut down VS 2012 through Task Manager (which takes forever since I have little use of the system at the time due to the 100% cpu usage).
The only way I have been able to build my solution is to rebuild it. Basically, I delete the .sln file. I then create a new one (by opening the first assembly) and build it. I open the next one…build it. I repeat this process until I have all assemblies built. Only after this am I able to rebuild the solution.
Note, that at some point, not sure when, I will once again not be able to build the solution and I have to go through this process over again.
Any ideas as to what might be causing this?
Here is some more information.
I am running VS 2010, VS 2012 and VS 2013 under a VMWare Virtual Machine. I do not think this matters as it open happens (as far as I can tell) with this one solution. It doesn't matter which version of VS I open it with, it will hang.
Really hoping someone can help me resolve this as it is eating into productivity.
UPDATE-----------------------
It appears that I am able to build this solution on the command line using MSBUILD. However, I still cannot debug the application since VS just hangs.

Related

TFS: Get latest causes slow project reloading

We're working with a solution which has multiple projects which references NuGet packages from other solutions.
Every time we do get latest from the TFS server on the solution, Visual Studio (2015) starts reloading each project in the solution which takes a really long time. Now this wasn't always the case, since this started happening only a few weeks back (the solution is a year old).
We have other solutions which were already experiencing this problem and our solution is to close the solution, then do get latest, then reload the project which is much, much faster.
Can anybody explain why this is happening and how to fix this issue?
This has been reported as a bug to MSFT, see Slow project reloading & Reload of projects is slow after call to TFS to get latest changeset. It seems your project files are updated from outside VS, which causes VS to load all them. More details please see the reply from VS IDE team:
Main culprit is, your project files are being updated from outside
VS, which causes VS to load each of them one by one. This is
extremely taxing process and it happens on the main UI thread. Hence,
this ASL logic is on-by-default to alleviate unresponsive solution
loads. Essentially, you’re pointing out a limitation in our ASL logic
that we hadn’t considered. This will be considered for a future
release, thank you.
In the meantime, one way to mitigate the problem would be to force
solution reload by touching the solution file, the *.sln file, which
will trigger ASL to kick in, basically VS thinking you’re doing full
solution load and it will optimize responsiveness time as much as
possible.
Ulzii Luvsanbat
Visual Studio IDE Team
Please try these steps:
Open Visual Studio installer and install the most recent available update for 2017 version.
Open %localappdata%/Microsoft/Team Foundation/7.0/cache and delete all files, then restart Visual Studio and retry.

Visual Studio Devenv.exe high cpu Usage

I am using VS 2013 ultimate, working on a project with Team Foundation Server. The problem is, every ten seconds, it hangs for up to 5 seconds, I am not compiling or anything, just writing code. Devenv.exe process jumps to more than 25% CPU and 670k of RAM. I have looked at the output from the JavaScript Language Service, and it constantly checks and says Referenced file 'D:\tfs\xxx.aspx' not found. Text search of the filename xxx.aspx in entire solution turns up nothing and I have the latest version. I think this is the reason of the spikes, does anyone know how I can turn off this feature in VS 2013?
EDIT: I have looked at other solutions, Browser Link is closed, I have the latest update
EDIT: I have found the solution, but I dont think it will really help anyone else. One of the guys referenced a hard drive path on top of a javascript page, and since the project is tens of thousands lines, cpu spiked as Visual Studio was searching it. Deleting the references helped in my case.
To narrow down this issue:
Try to disconnect from TFS server. (In VS→ Team → Disconnect from
Team Foundation Server) Check whether this abnormal phenomena still exist.
Use devenv/resetuserdata command to clear user settings of VS,
details refer to this blog: VSTS Tip: devenv /resetuserdata
If you are using proxy in your machine, try to disable the proxy
settings.
If there is anti-virus in the machine, also try to disable it.

Visual Studio 2010 (devenv) Hung Process After Closing

I have problem with Visual Studio 2010 on Windows 7 64-bit. After some time of work VS starts consuming ~50% CPU and UI responding slows down. When I close VS then UI disappear but process stay.
When I forgot to kill those hung processes at the end of day, I will end up with numerous devenv.exe processes.
I have reinstall Visual Studio and reinstall Windows and ended up with the same problem... doesn't change anything. Please help. :/
Remove and/or uninstall all third-party Visual Studio add-ins and extensions. Disabling is not good enough.
Visual Studio 2010 relies heavily on graphics. Therefore:
Update your video driver.
Turn off "Enable rich client visual
experience"
Turn off "Use Hardware graphics acceleration if
available"
There are also temporary files that Visual Studio uses that may need to be cleared out.
Clear out your %temp% folder.
Clear out %AppData%\Local\Microsoft\WebsiteCache
Clear out %AppData%\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies
Your project and solution user settings may be corrupt due to so many "crashes".
Delete .user and .suo files (you will lose the startup project, bookmarks, breakpoints, and other user settings specific to projects and solutions.)
Begin where you began before - it may seem overkill but this is the only way to be sure we are addressing everything short of hardware issues.
Reinstall Windows - make sure you are using a validly licensed copy, and patch the hell out of it before installing Visual Studio.
Note: I doubt it is a GPU driver issue, but it never hurts to use the most up to date driver and this is the place to do it right after a fresh OS install.
Install Visual Studio .Net 2010 but do not start it up. Let it get the frameworks installed fresh.
Use Windows Update to install the VS 2010 SP1 patch, and any/all patches for .Net frameworks.
Make an images for yourself right here so you have something to build from if you need to try this again. It will save you lots of time.
Fire up Visual Studio, and test your closing before installing anything else.
If it does not work here, there's likely some conflict between PC hardware and window OS, and you should try to find this symptom in other applications to get more info.
Here's what i would be looking for:
Does it happen EVERY TIME?
Does it happen after you debug your project ? does it happen for ALL projects?
Does it also happen when you don't load any projects? (simply start the IDE and wait).
Does it happen after a debug session of your application? maybe the application is not closed properly?
Do you have any other apps running at the same time that may cause this? try reproducing with a minimal set of apps/services running.
What are you doing exactly when it starts freezing ? anything in particular?
I would try to get 2-3 memory dumps at the time of hanging, post it here as well as to MSFT people. That would be a good start.

Visual Studio 2010 debugger skipping

Occasionally during debugging the debugger skips forward randomly. Sometimes I Step into a function inside of another function and instead of going to the next line it skips through to a seemly random place in the future. sometimes to a line partway through another function.
It always seems to respect breakpoints though, i.e. if a breakpoint is set in the future it never will skip past it.
I'm running 64 bit Win 7 and visual studio 2010 ultimate. I'm not using threads. This never happened for me in visual studio 2008. How can I fix this?
Do you have optimizations turned on? If the program is highly optimized, the order of execution can be thrown off, and things can be expanded or rearranged in ways that are not always clear.
I'm running into similar problems debugging a C# program with Visual Studio 2010 on an XP machine. The debugger just randomly skips to some other line or the next break point.
It seems that Microsoft has released a Fix for this in the SP1.
Are you sure that the assembly your code calls has debug symbols? You maybe referencing a dll that was compiled in release mode.
This can happen when the debugger is running against pdb files that don't match the source code you are looking at. Make sure the bin (or where you are running from) is up to date and was built from the same source code you are running in the debugger.
Are you using threads or background workers? When debugging I believe that all threads are paused so it could be switching between them. Otherwise you may have out of date debugging information, Delete your bin and obj directories and do a clean build.
This can also happen when your Debug solution configuration is up to date, but you try to debug the program in Release configuration (if that is not also up-to-date)... or vice versa.
You can switch back and forth between running in Debug or Release configuration using the drop-down next to the green 'play' arrow at the top of the screen.
I had a similar problem in Visual C++ 2008 on Windows 7 32-bit recently. Several minutes before the problem first appeared, a system dialog window “VC.exe encountered a problem and needs to quit” was displayed but the Visual C++ window seemed to survive.
After the problem first appeared, I tried several ways to getting it back to work like rebuilding the solution or restarting Visual Studio. However, it continued to behave strange: It failed to link with an object file I hadn’t touched for weeks, displayed “The breakpoint will not currently be hit. The source code is different from the original version.” etc.
Nothing helped until I rebooted the computer and finally rebuilt the solution (twice, actually).
Click Rebuild Solution.

Visual Studio 2005: How to speed up builds when a VSMDI is open?

Using Visual Studio 2005, if I open tests in a VSMDI and try running tests, it sometimes re-builds projects. However, these builds go extremely slow. The CPU is 99% idle and the output window shows VS clunking along compiling things. Is there any way to fix this? It makes no sense. Upgrading isn't necessarily a viable option for those of us with shared legacy code to deal with.
Have you tried upgrading to SP1? I don't know of any specific issues in this area but this would be the first change I tried to make.

Resources