Visual Studio (2012) hangs when adding new controller

Posted on Jul 6, 2013 | Categories: coding, visualstudio


Whereas working with visual studio is pretty straightforward most of the times the times you get stuck you get stuck (for) good.

The problem definition:

Visual Studio 2012 says it’s in a busy state when you try to add an new controller in a MVC 4 project.

How to solve:

Probably you have moved your project around between some computers or something like that. The problem is that some DLL files are locked. Or you can unlock all DLL files in your packages folder in your MVC4 solution (which I don’t know how to do) or you can create an new MVC4 solution and copy the packages folder from that solution to the solution you have the problems with and overwrite that folder.

This is a little nasty issue I’ve spend some hours on. So: dude, never forget that shit happens when you’r moving solutions between different computers! (Edit in 2015: or use git)

Edit:

I found accidentally how to unblock single files. This article on MSDN explains how to unblock the single assemblys. After some searching I found a method to unblock whole folders. To do this you need this SysInternals tool. Next run the command prompt with administrator privileges and use the following command:

streams -s -d C:/PathYouWantToUnlock

If everything works well you can continue devving :) Good luck folks!