.NET Core 2.2发布问题

时间:2019-05-25 14:04:22

标签: asp.net core

我有一个支持ASP.NET Core 2.2的虚拟主机。我试图在其中发布自己的asp.net core 2.2项目,并且仅在设计时就可以使用。然后,我在项目中添加了Identity,并在主机中添加了相同的数据库(通过迁移创建的导出和导入的db)。我也更改了数据库连接,但是当我尝试发布相同的项目时,它给了我这个错误:

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681

这是我的连接字符串:

"ConnectionStrings": {
    "IdentityConnection": "Data Source=.\MSSQLSERVER2016;Database=ChatIdentity;Integrated Security=False;User ID=halitkal;Password=v*Q9zp07;Connect Timeout=15;Encrypt=False;Packet Size=4096"
  },

这是我的webconfig文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\ChatSite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 028aa0e3-c5ef-4f5c-87ac-e8de39c5ca44-->

1 个答案:

答案 0 :(得分:0)

通过更改web.config中的下一行来打开标准输出日志

aspNetCore processPath="dotnet" arguments=".\ChatSite.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />

请不要忘记在与dll文件相同的目录中创建一个名为logs的文件夹。

然后重新启动应用程序(如果您在IIS中托管,则重新启动应用程序池),然后发出http请求,然后检查生成的日志,这应该为您提供有关错误的详细信息。

如果这不起作用,请确保已安装正确的运行时。

相关问题