Visual Studio hangs on Sitecore solution load?

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:

Hang

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:

Parsing

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:

TDS Setting

This change allowed me to load the solution again without a hang. So far, it has kept working since then.

So…

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 v5.0.0.22 provides a fix that should address this issue. Clearly I didn’t have the latest version of this after all…

Advertisements

2 thoughts on “Visual Studio hangs on Sitecore solution load?

  1. Hi Jeremy,
    My name is Charles Turano. I am one of the developers on TDS. Thanks for the detailed description of your project. This make help us track the problem down. Can you tell me what VM you are using and how many CPU’s you have dedicated to the VM?
    I think I resolved the issue with 5.0.0.22, but I can’t be sure since we are unable to reproduce the problem here. Please try setting Background Cache Loading back to “true” once you install the .22 release. If the problem shows up again, please let us know at support@hhogdev.com.

    Thanks

    Charlie

    • Hey Charles – thanks for the great pro-active support here.

      Device Manager inside the VM says there are two Xeon E5620 cores visible to Windows. I believe it’s a Windows 2008 HyperV server underneath, but I don’t have access to the physical machine to check the specs on that. The VM’s OS is Windows Server 2008 SP1, if that makes any difference.

      I’ll try installing your latest release and reverting that setting, and see if the problem stays away.

      Thanks again – Jeremy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s