NETCore项目报错 An error occurred while starting the application

Posted luckypc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NETCore项目报错 An error occurred while starting the application相关的知识,希望对你有一定的参考价值。

技术图片

 

在发布到IIS的webApi项目中,运行时报出以上错误,

解决方法:

1、打开发布目录文件夹,找到web.config文件

技术图片

2、打开web.config找到stdoutLogEnabled="false",把该值改为true,即->stdoutLogEnabled="true"

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\\CMS.WebApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\\logs\\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>

3、新建logs文件夹,再次运行网站,这时会自动生成一个log文件到logs文件夹中,打开即可查看报错原因进行处理了。

 

以上是关于NETCore项目报错 An error occurred while starting the application的主要内容,如果未能解决你的问题,请参考以下文章

[Bug0061] RabbitMQ 报错 An unexpected connection driver error occured

clon远程项目后,npm install 报错——cb() never called!This is an error with npm itself. Please report this err

Eclipse报错An internal error occurred during: "J2EE Component Mapping Update". java.lang.Nul

IDEA的maven web项目启动后报错:The server encountered an internal error () that prevented it from fulfilling

Myeclipse运行报错:an out of memory error has occurred的解决方法

php-fpm开启报错-ERROR: An another FPM instance seems..