当前位置: 移动技术网 > IT编程>开发语言>.net > NETCore项目报错 An error occurred while starting the application

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

2019年06月07日  | 移动技术网IT编程  | 我要评论

乡音苑网站,穆兹一家的团聚,吐槽大会第一期无删减

 

在发布到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文件夹中,打开即可查看报错原因进行处理了。

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网