I always had connectionString in following files: appsettings.json and appsettings.Development.json. But then I realized. It's enough to have it one place - appsettings.json. Because it's replaced in CI builds anyway. So I removed it from there and application is still working fine.
But then I was trying to update database with command dotnet ef database update --Context AppIdentityDbContext and it turned out that i cannot because dotnet cannot find connection string
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: Could not find a connection string named 'Identity'.
So now I'm forced again to revert that connection string in appsettings.Development.json.
Is there anyway to get rid of it that connectionString from that file. I don't see any reason to keep in two places, just because of that minor reason.