enable-migrations error : project failed to build

Viewed 34582

Using ASP.NET MVC4 with EF4.3

Running Enable-Migrations from PM Console

System.Management.Automation.RuntimeException: The project 'MyProj' failed to build. The project 'MyProj' failed to build.

The project builds (control-shift-B)

Is there any way to get more detail on this error to diagnose?

6 Answers

In my case I had errors in my project. I have cleared all other errors in my project. Then it works well.

In my case there was a message in the Visual Studio output window that made much more sense.

PosmasterDBContext' does not contain a definition for 'Products' and no extension method 'Products' accepting a first argument of type 'PosmasterDBContext' could be found (are you missing a using directive or an assembly reference?)

I knew right away that somewhere in my code, I changed Products to Product

Once I reverted it to Products, the error disappeared.

Related