打开网站下的web.config
<aspNetCore processPath="dotnet" arguments=".\xxx.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
改为
<aspNetCore processPath="dotnet" arguments=".\xxx.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
然后在logs目录下查看原因,再去解决。如果网站下根目录没有logs,要手动创建,见原文链接。
记录找到原因解决后,把上面的true改回false。
示例一:依赖文件缺失
Application startup exception: System.ArgumentException: The directory name D:\wwwRoot\node_modules\ is invalid.
示例二、数据库连接错误
Application startup exception: System.Data.SqlClient.SqlException (0x80131904): 用户 'sa' 登录失败。
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
原文链接