rafasoares
rafasoares

Reputation: 425

MVC: "no model classes are available" even after Build/Clean/Rebuild

I'm working on a little project and after a while, my model and data context classes disappeared from the Add Controller window.

I have generated one controller with views normally before.

Of course, I have built, rebuilt, cleaned and rebuilt, cried, cursed and threatened my computer, none of them worked.

Some useful information (or not-so-useful):

Thank you very much.

Upvotes: 2

Views: 3197

Answers (2)

Vincy
Vincy

Reputation: 1078

If you still have this problem then 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, it will ask you whether you want to overwrite the existing references (not sure about the exact phrase). So, say "Yes" to overwrite...

Now try to add the controller to your project and everything will be fine.

Good Luck!

Upvotes: 2

Its me Mario
Its me Mario

Reputation: 1

Have you considered "searching" on entire project for the DataAnnotations and other stuff you uninstalled?? (I don't know if you mean it by "cleaned and rebuilt").

Have you tried to install these "bad stuff" again in order to get your stuff working again?

Well, i would start this way, and then after cursing, smoking, and knocking my head against a wall... i would consider getting high and starting all over again...

Good luck pal!

Upvotes: -1

Related Questions