Stage
❔ Host Can't be Null error when trying to run db migration using postgres
Reviving this just to tell anyone who stumbles across this like I did: The only thing that fixed this for me was to remove my design-time DbContextFactory implementation, which had a default constructor. A tell-tale sign you have the same issue is to run
dotnet ef database update
with a valid connection string as a CLI argument: --connection "<connection str>"
. The key is to get rid of any design-time factories / ways a DbContext
can be instantiated without valid credentials. Hope this helps! (This assumes you have an otherwise valid configuration etc.)18 replies