Update: I’ve just had a reoccurrence of the issue described below, and the steps I mention resolved it.
A very lengthy and precise title, but this one has been a bit of a pain in the arse. Google hasn’t helped much, so hopefully the next poor git who encounters this issue might stumble upon this post.
So, the problem is this – the ‘Add Controller’ dialog box in Visual Studio 2013 sometimes doesn’t populate he ‘Model Class’ and ‘Data Context Class’ dropdown boxes when you’re tried to add a new scaffolded controller to an MVC project.
Everything was working fine for me initially, and then it mysteriously stopped working. Googling seemed to suggest a simple rebuild of the project would do the trick (it didn’t).
It’s now working, and whilst I’m not sure it’s down to the fiddling I’ve down or just pure chance, here’s a list of the actions I took to attempt to resolve this very irritating problem:
– Unload the .csproj file
– Manually look through the .csproj for any dodgy references. I found VS had added
– Reload the the .csproj file
– Clean the solution
– Rebuild the solution
I’ll update if it breaks again and update the steps to resolve accordingly. I can’t seem to find any information that explains the datasource of that dialog – where it gets the model lists from.
Link to similar issue: