Tuesday, August 18, 2015

ASP.Net MVC - Package Manager Console command error "No context type was found in the assembly '{assembly.dll}'."

We end up with an error message "No context type was found in the assembly '{assembly.dll}'." when trying to execute a Package Manager Console command "enable-migrations".

This is because there is no database context class exists.

So all we need to create a new class with any name and inherit that with "System.Data.Entity.DbContext".

Now execute the command "enable-migrations" again. This time it should enable it.

Simple though!

No comments: