0

I am using Visual Studio Express 2013 for Web, I am attempting to create a new controller in my asp.net MVC application. I am using Entity Framework 5 with code first (.NET 4.5).

I want Visual Studio to create the template for me - However, every time I try to create the controller I get the following error message:

There was an error running the selected code generator: 'unable to retrieve metadata for 'CII.Domain.Password'. unable to load the specified metadata resource

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
sara k.
  • 1
  • 10
  • Can you give some screenshot of your project and the error please? – Festim Cahani Aug 12 '15 at 20:26
  • I made changes in the DB and then I updated the model ('UPDATE MODEL FROM DATABASE'), and since you can not access at all to DB and add a controller. Is there another place where there is change after the update? Thank you very much! –  sara k. Aug 13 '15 at 16:05

2 Answers2

0

I had the same error myself - I tried to search for solutions on StackOverflow and found this, suggesting Admin Rights or to add <loadFromRemoteSources enabled="true" /> to C:[Visual Studio 2010 Install Dir]\Common7\IDE\devenv.exe. ()

The solution I had was to build with any of the latest changes, clean the solution and then rebuild.

I know it's a simple answer but doing this worked for me - I had not built the solution since adding a new Model and when I tried to add the controller scaffolding it was giving me an error. So: Build, Clean, Rebuild the solution after the model is added.

Community
  • 1
  • 1
John Youngtree
  • 401
  • 3
  • 10
0

I encountered this problem many times. And after "Bulid" Is resolved!!

sara k.
  • 1
  • 10