i'm trying develop microservice with dotnet core 5, postgresql and docker.
i have postgresql container and MyApp container.
i'm migration database in program.cd
my connection string is ConnectionString=Server=postgresdata;Database=PadCMS.Accounting;User Id=postgres;Password=rb9370029
and whene used context.Database.Migrate(); i'm get exception.
System.Net.Internals.SocketExceptionFactory.ExtendedSocketException: 'Name or service not known'
This exception was originally thrown at this call stack:
System.Net.Dns.GetHostEntryOrAddressesCore(string, bool)
System.Net.Dns.GetHostAddresses(string)
Npgsql.NpgsqlConnector.Connect(Npgsql.Util.NpgsqlTimeout)
Npgsql.NpgsqlConnector.RawOpen(Npgsql.Util.NpgsqlTimeout, bool, System.Threading.CancellationToken)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Npgsql.NpgsqlConnector.Open(Npgsql.Util.NpgsqlTimeout, bool, System.Threading.CancellationToken)
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
...
[Call Stack Truncated]