It is quite possible that this issue is entirely down to some odd aspect of the setup of the Virtual Machine I’m developing on at the moment, but recently I’ve experienced quite a few hangs when loading Sitecore solutions. Starting up Visual Studio to be greeted with a never ending progress bar:
Having Googled for ways to solve this problem and found little to help, I thought I’d write down what I’ve tried in case anyone else suffers similar issues.
Background to my issues…
I’m working on a virtual machine that has Visual Studio 2012 and 2013 installed. They both have Hedgehog TDS and Sitecore Rocks added. These are all “latest versions” and recent Windows Updates have been installed.
My solution consists of three TDS projects and an ASP.Net web application. It was created in VS2012, but is now developed in VS 2013. Irregularly, when I ask Visual Studio to load the solution, VS will hang. Task manager says Visual Studio is using 0-1% CPU, so it seems to be waiting for something to happen. Most of the time this will be while it shows the “Preparing Solution” progress bar shown above. However I have also seen the issue after doing a get-latest from source control that causes the solution to be re-loaded. In that case it hangs with the following visible in the status bar at the bottom of the VS window:
In both cases, the only way to recover from the hang is to terminate the Visual Studio process. And attempts to re-load the solution at this point will just cause the hang again. Having had VS2013 hang, I have tried opening the solution in VS2012. This suffered from the same problem.
I first experienced the issue after a network outage broke our office Team Foundation server for a few hours. Subsequently I’ve experienced the issue again after updating Visual Studio add-ons (such as TDS) and after having worked on an unrelated Solution which used Git for source control instead of TFS. However despite all of these issues I have been unable to pin down a repeatable cause. Obviously I can’t break TFS on demand, but I’ve tried re-creating the other conditions without being able to reliably reproduce the issue.
Things I tried to fix it…
Googling for terms related to this Visual Studio hang generally bring up bug reports relating to old (especially beta) versions of Visual Studio. Things like:
A common theme in the posts I read were that these issues were most likely to be related to add-ons to Visual Studio. There are suggestions for disabling add-ins or resetting Visual Studio configuration. However neither of these worked for me. Obviously I can’t develop my project without TDS, and removing Sitecore Rocks didn’t fix my issue.
I tried re-installing the most recent versions of TDS and Sitecore Rocks. This did appear to solve the issue, as having done so I was then able to load my solution again. However later the issue returned. That suggests to me that the install process changed something that helped, but it was something that changes over time anyway and hence the issue could reoccurred.
The next thing I tried was creating a new Solution file. After suffering another hang at load-time, I created a new solution and added only the Web project to it. This would reliably load. I added the TDS Core project again, and this would reliably load. I added my TDS Test data project and the solution still loaded. Finally I re-added the TDS Master project, and at this point the solution worked for a while before it stopped loading again.
This made me think that the issue might be something to do with either the serialised data or the state / config of TDS for this solution or VM. So I tried a more detailed search of the Hedgehog site. While this didn’t find any data about load-time hangs, I came across info that pointed to a configuration option for background loading of its cached data. So I tried changing this to false, to avoid background loads:
This change allowed me to load the solution again without a hang. So far, it has kept working since then.
I can’t say why the solution broke, or what the real cause of the issue was. But if you suffer similar hangs, try disabling background loading of the TDS cache and see if that works for you…
Editied to add:
After posting this, Kamruz Jaman pointed out on twitter that TDS update v22.214.171.124 provides a fix that should address this issue. Clearly I didn’t have the latest version of this after all…