MVC 3 and ASP.Net with Entity Framework Architecture Error: No Model Classes

I'm trying to use MVC3 with Entity infrastructure with First code, but the process of generating a code template in MS Visual Web Developer 2010 - does not detect my model in the models folder - it gives a message - "There are no model classes" - although I have model classes for which I want to create controllers.

The selection of the template that I selected is "Controller with read / write actions and views using the Entity Framework."

I uninstalled and reinstalled Web Developer 2010, but still have the same error.

Does anyone know how I can get around this error?

+7
source share
6 answers

The answer to xixonia worked for me. All I had to do was build / rebuild the project, and then everything worked as expected.

+14
source

Rebuild didn’t fix this problem for me ... until I closed Studio, opened and restored everything. Then it worked like a charm.

+8
source

I had the same problem, and for me I had to go to the properties of the entity model in the design of the entity model and change the code generation strategy to the default value. It was installed in None because I was experimenting with a DbContext generator.

0
source

I had the same problem.

While copying my links, before throwing the computer on the wall, I found that I had EntityFramework version 4.1 installed in a web project (VS 2010, when MVC 3 was created).

I had 4.3.1 installed in a domain project (from nuget).

I uninstalled them and reinstalled from nuget.

Now everything works again.

Hope this helps.

0
source

If you still have this problem, follow these steps to fix the problem:

1. Right click on your project and select [Manage NuGet Packages] 2. On the opened popup window, on the left hand pane, select Updates 3. On the right hand pane, at the very top right click on the Update All 

During this process, he will ask you if you want to overwrite existing links (not sure about the exact phrase). So say yes to overwrite ...

Now try adding a controller to your project and everything will be fine.

Good luck

0
source
0
source

All Articles