The Problem
You’ve been upgrading and downgrading Entity Framework, and just when everything seems to be working, you get an error of
Schema specified is not valid. Errors:
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared..
<File Unknown>(0,0) : error 2025: XML Schema validation failed for mapping schema. Schema Error Information : The ‘http://schemas.microsoft.com/ado/2012/10/edm/migrations:IsSystem’ attribute is not declared.The Cause
The data migrations have gotten out of sync
The Solution
The solution (use at your own risk)
- Delete the migrations folder and
- Drop the _MigrationHistory table in the database
- Run Enable-migrations -Force in the package manager console
- Add a migration
- Check the migration file that is created – it should have a listing of your entire database – delete the table creation and dropping code
- run update-database -verbose
You should be back in business!
|
Written By Steve French |
Leave a Reply