.netCoreApi5.0+部署iis站点webconfig配置 HTTP 错误 500.24 - Internal Server Error的解决方法

发布时间 2023-11-07 17:01:57作者: 一只奋斗的小小鸟

 

<?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=".\PLCSYS.APi.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
    </aspNetCore>
    </system.webServer>
  </location>
</configuration>

保存为web.config放到iis根目录即可!