You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求协助排查.NET Core Web API的HTTP Error 500.19错误

Fixing HTTP Error 500.19 - 0x8007000d for .NET Core Web API on IIS

Hey there, let's work through this annoying 500.19 error you're hitting. That specific error code (0x8007000d) almost always means IIS can't parse your web.config file—either because it's malformed, has unrecognized settings, or the server lacks the right tools to handle .NET Core apps. Here's how to fix it step by step:

1. Double-check your web.config syntax

First, crack open C:\inetpub\wwwroot\webapi\web.config and scan for obvious issues:

  • Missing closing tags (like a forgotten </> for a configuration section)
  • Typos in section names or attributes
  • Configuration sections that IIS doesn't recognize (common if you copied settings from a non-IIS environment)

For a standard .NET Core Web API, your system.webServer section should look something like this—make sure yours matches (swap YourApi.dll with your actual assembly name):

<system.webServer>
  <handlers>
    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
  </handlers>
  <aspNetCore processPath="dotnet" arguments=".\YourApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>

2. Install the ASP.NET Core Hosting Bundle

This is the most common fix. IIS needs the AspNetCoreModuleV2 to run .NET Core apps, and it's included in the ASP.NET Core Hosting Bundle.

  • Install the bundle (match it to your .NET Core version)
  • After installation, restart IIS by running iisreset in Command Prompt or PowerShell
  • Try accessing your API again

3. Verify folder permissions

IIS's application pool identity needs read access to your API's directory. Here's how to set it:

  • Right-click C:\inetpub\wwwroot\webapi → Properties → Security tab
  • Click Edit → Add
  • Enter your app pool name (usually IIS AppPool\[YourAppPoolName]) and click Check Names to confirm
  • Grant the identity Read & Execute, List folder contents, and Read permissions
  • Click OK to save changes

4. Match .NET Core runtime versions

Make sure the server has the exact .NET Core runtime version your API was built for. To check installed runtimes on the server:

dotnet --list-runtimes

If the version doesn't match, either:

  • Update the server's .NET Core runtime to match your project's target version
  • Or adjust your project's target framework to match the server's installed runtime, then re-publish

5. Enable detailed logging for deeper insights

If the above steps don't work, turn on stdout logging to get more details about what's failing:

  • Edit your web.config and set stdoutLogEnabled="true" in the <aspNetCore> section
  • Create a logs folder in your API directory (if it doesn't exist)
  • Access your API again, then check the log files in C:\inetpub\wwwroot\webapi\logs—they'll have specific error messages to point you to the root cause

内容的提问来源于stack exchange,提问作者mehrannva

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:44:05