Asp.net web api 如何在Heroku上为我的.net核心web API配置Postgres

Asp.net web api 如何在Heroku上为我的.net核心web API配置Postgres,asp.net-web-api,heroku-postgres,Asp.net Web Api,Heroku Postgres,我已经在Heroku上成功部署了一个.net核心web API,但应用程序未能启动。当我尝试运行应用程序时,出现以下错误: 错误R10(启动超时)->Web进程未能在启动后60秒内绑定到$PORT 下面是连接字符串my.net核心代码 "ConnectionStrings": { "DromiContext": "User=user;Password=password;Host=host;Port=5432;Database=database;Integrated Security=true;P

我已经在Heroku上成功部署了一个.net核心web API,但应用程序未能启动。当我尝试运行应用程序时,出现以下错误: 错误R10(启动超时)->Web进程未能在启动后60秒内绑定到$PORT

下面是连接字符串my.net核心代码

"ConnectionStrings": {
"DromiContext": "User=user;Password=password;Host=host;Port=5432;Database=database;Integrated Security=true;Pooling=true;"
}

相关问题
应用程序未配置为自动运行迁移。更新后,

`

使用(var serviceScope=services.BuildServiceProvider().GetService().CreateScope())
{
var context=serviceScope.ServiceProvider.GetRequiredService();
Migrate();
}
`


错误消失了

欢迎使用堆栈溢出。请花几分钟复习。你的问题缺少大量重要信息。请尝试为您正在使用的相关框架/语言添加标记,并编辑您的问题,以包含有用的信息,如启动Web服务器的应用程序代码以及任何其他相关信息。
using (var serviceScope = services.BuildServiceProvider().GetService<IServiceScopeFactory>().CreateScope())
            {
                var context = serviceScope.ServiceProvider.GetRequiredService<DromiContext>();
                context.Database.Migrate();
            }