I created a separate class library project to store database context classes and models. In the same solution, I created an ASP.NET MVC project and referenced the class library project, and also included a connection string for the database context in the Web.config project file.
However, when I try to add a controller (with views using EF), I get the following error:
An exception is thrown by the call target.
I can see the database and model context classes in the Add Controller drop-down lists, so I don't think this is a link problem.
If someone is also experiencing this error (with this configuration), your help will be greatly appreciated.
asp.net-mvc entity-framework dbcontext
Noximus
source share