asp.net mvc5 scaffolding Unable to retrive metadata for ...Ambiguous match found

asp.net-mvc-5 asp.net-mvc-scaffolding entity-framework-6 scaffolding

Question

Problem: When I want to create controller from EF codefirst context it give me this error:

There was an error running the selected code generator.Unable to retrieve  metadata for Model.class name.Ambiguous match found.

See Error Image

What I did?

  1. As my model data was in seprate assembly I updated all package or downgrade them but nothing happened.
  2. Then I merged my Model assembly in Website project but error doesn't resolved.
  3. After googleing and many tricks, I created clean project and scaffolding for each class but it seems only one class had this problem.
  4. In that class I commented all property and uncomment one by one to find error.
  5. Found it! For this property error occurs public bool ISActive { get; set; }

I surprised so much and found how dot net turture you!! What do you think about solution?!!

1
2
3/27/2018 6:17:18 AM

Accepted Answer

Renaming ISActive property to something else such as IsActivated solved my problem.It seems EF scaffolding has problem with this type of naming while cruding.

0
7/22/2016 7:34:23 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow