Your target project doesn't match your migrations assembly ,have you seen this issue while working on migration. Please let me know why this issue faced
Loading
Your target project doesn't match your migrations assembly ,have you seen this issue while working on migration. Please let me know why this issue faced
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Jan 30, 2023, 10:11 AM
@Ankush,
In your package Manager Console, there is a dropdown where you need to select the project that includes the DBContext file or Migration Folder, and make sure there is no pending migration.
If you are firing migration from local with live connection string then check the migration file inside live/production server database, it should be present there and latest migration file name should match to your local migration folder's last migration file name.
Then this error will be resolved.
Vishal JoshiPosted Jan 30, 2023, 9:12 AM
Hello
The target project should be the project that contains the migrations assembly, and the migration assembly is the assembly that contains the DbContext. If you are using visual studio for development, you just need to change the default project to the class library project that contains the DbContext.
For NET Core CLI, the default project can be mentioned in the migration command as given below.
Thanks
Naimish MakwanaPosted Jan 30, 2023, 9:11 AM
Hello Ankush,
Please refer below link:
https://github.com/dotnet/efcore/issues/5900#issuecomment-229483068
Thanks
Naimish