I am adding a new migration but this message shows:
Unable to generate an explicit migration because the following explicit migrations are pending:
Check the connection string again.
Make sure the user you are connecting with still has permission to read from [__MigrationHistory]
and has permission to edit the schema.
You can also try changing the connection string in the App or Web config file to use Integrated Security (Windows Auth) to run the add-migration command as yourself.
For example:
connectionString="data source=server;initial catalog=db;persist security info=True;Integrated Security=SSPI;"
This connection string would go in the App.config file of the project where the DbContext is located.
You can specify the StartUp project on the command line or you can right click the project with the DbContext
, Configuration
and Migrations folder and select Set as StartUp project. I'm serious, this can actually help.