1

I am working PluralSight Video Tutorials on ASP.NET MVC. And i couldn't enable migrations on package console..

when i wrote enable-migrations, i am receiving this error;

More than one context type was found in the assembly 'eManager.Web'. To enable migrations for eManager.Web.Infrastructure.DepartmentDb, use Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb. To enable migrations for eManager.Web.Models.UsersContext, use Enable-Migrations -ContextTypeName eManager.Web.Models.UsersContext.

when i wrote Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb., i am receiving this error;

The context type 'eManager.Web.Infrastructure.DepartmentDb.' was not found in the assembly 'eManager.Web'.

Thanks for your help.

3 Answers 3

2

I strongly suspect that your issue is similar to the one in this question:

How to Enable Migration to update my database in MVC4?

Check the selected answer and see if that helps with your issue.

Sign up to request clarification or add additional context in comments.

Comments

1

The solution for the mentioned error "The context type .... was not found" is to select the correct project that holds the context type before running the enable-migration command. You can choose the correct project from the "default project" drop down at the top of Nuget manager tool window.

Comments

0

The solution to this problem is simple, just remove the dot (.) at the end of this statement "Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb." and run the package manager console again, the migration should be enabled.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.