.net core mvc发布后 iis 显示异常错误信息的方法,同时添加的webapi方法启动 HttpPut, HttpDelete谓词

一,iis 显示异常错误信息的方法

 

在发布的项目文件夹中找到web.config文件,修改:

 

<aspNetCore processPath="dotnet" arguments=".\Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />

为:

 

<aspNetCore processPath="dotnet" arguments=".\Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" >
       <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
</aspNetCore>

 

 

二,webapi方法启动 HttpPut, HttpDelete谓词

   默认报405 Method Not Allowed 错误

  同样在 web.config 下添加如下代码

   

<modules runAllManagedModulesForAllRequests="true">  
      <remove name="WebDAVModule" />  
</modules>  

 

 

 

  

posted @ 2020-07-09 09:42  qingjiawen  阅读(375)  评论(0编辑  收藏  举报