IIS下跑.NetCore应用程序出错报An error occurred while starting the application如何查看日志

打开网站下的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)

原文链接

https://scottsauber.com/2017/04/10/how-to-troubleshoot-an-error-occurred-while-starting-the-application-in-asp-net-core-on-iis/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值