IIS fails to run ASP.NET Core site - HTTP Error 502.5
IIS fails to run ASP.NET Core site - HTTP Error 502.5
回答1
Your problem is a bad web.config file:
<aspNetCore requestTimeout="02:00:00"
processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />
The path %LAUNCHER_PATH% does not exist on your system, it is not even valid. It should be something like:
<aspNetCore requestTimeout="02:00:00"
processPath=".\yourAppName.exe"
arguments="somePossibleArgument"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />
Notice that the web.config file is completely ignored if the app is launched from the command line, that's why you do not receive the error.
回答2
I had this same problem, My issue were IIS was not able get the path to dotnet. I was able to fix it by specifying the path to the dotnet.exe
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\your-project.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"/>
</system.webServer>
</configuration>
回答3
My problem was that the process wouldn't start due to an invalid escape sequence in my appsettings.json
file.
I'm using dotnet to run the published ASPNET Core 2 web api dll. The problem was revealed by opening a command prompt and navigating to the directory where the site files are located. Once there, I ran the command:
dotnet mySite.dll
(change mySite.dll to the main dll of your app. Also, make sure the correct version of the .NET Core Windows Server Hosting bundle is already installed).
Pressing enter, it immediately crashed giving the exact feedback in the console window of what was wrong. That's a great way to help determine your startup error(s) if you are having similar troubles.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2021-12-06 Use and utility of .p12 certificate/file
2021-12-06 How is OAuth 2 different from OAuth 1?
2021-12-06 Why OAuth 1.0a?
2021-12-06 SlowCheetah - Web.config Transformation Syntax now generalized for any XML configuration file
2021-12-06 外服薪资代发服务
2017-12-06 用select拼接insert into,单引号转义
2017-12-06 File and Folder Permissions