码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2019-06-06 17:26:12      阅读:433      评论:0      收藏:0      [点我收藏+]

标签:oca   etc   config文件   version   tar   mod   out   nbsp   otn   

技术图片

 

在发布到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

标签:oca   etc   config文件   version   tar   mod   out   nbsp   otn   

原文地址:https://www.cnblogs.com/luckypc/p/10985927.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!