I have code in mine ConfigureServicesthat does not work when doing the migration:
dotnet ef migrations list
I am trying to add a certificate, but it cannot find the file (it works when the project as a whole starts). So, there is a way to do something like this:
if (!CurrentEnvironment.IsMigration()) {
doMyStuffThatFailsInMigration()
}
That way, I could save my code as it is, but just execute it when it doesn't start during the migration process.
thank
source
share