Reputation: 1826
We are attempting to add MVC to an old, large, legacy webforms app. (The intent is to gradually re-implement portions of the app using MVC until the old app is gone).
Setting it up has gone smoothly. We have an MVC Area, and I created a controller which is accessible when running the app, by means on directly typing the url.
But whenever we "Add > Controller" or "Add > View"... Visual Studio hangs for around 10 minutes "Not Responding".
Clearly there is some bug in visual studio interacting with some quirk in our legacy project.
Googling, I have so far found only a few similar cases that are old & do not seem applicable.
Not sure where to begin resolving this.
UPDATE:
For what it is worth, we have converted the original VB webforms project to C#. I then added MVC Nuget package and and MVC area. Visual studio no longer seems to hang when adding controllers. So this might be a VB specific thing. Or maybe some windows update to visual studio fixed this in the interim since i posted this. Not sure.
Upvotes: 17
Views: 3151
Reputation: 863
It is still in Visual Studio 2017; It takes time and you can restart making Controller/View or you can wait sometimes
Upvotes: 1
Reputation: 353
In my case this situation arises when adding view to the controller and visual studio 2015 hangs indefinitely. However it creates the view file in the directory but not shown in solution explorer. I have manually copy pasted the file from directory to solution explorer and everything worked well.
Check if the below blog could help resolve your issue http://digioz.blogspot.co.uk/2013/06/visual-studio-2012-freezes-or-crashes.html
Upvotes: 0
Reputation: 111
The problem is still present in Visual Studio 2015 Update 1.
As a workaround, instead of selecting "Add View" you can select "New Item" and choose a page template from Web/MVC instead.
Upvotes: 7
Reputation: 31
I'm having the same issue. This should work. I'm selecting "Add Controller" from the context menu. It just spins saying Visual Studio not responding. This is with Visual Studio 2015.
Upvotes: 0
Reputation: 75
this seems like bugs from visual studio, you can copy other controller and paste it then rename namespace. for temporary until visual studio is fixed.
Upvotes: 0