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

HTTP Error 500.19报错排查:IIS/VS仍指向已删除路径问题

Fix: VS Debug Shows HTTP 500.19 Instead of Code Error (Stuck on Deleted Path)

I’ve run into a similar frustrating issue before where VS gets stuck referencing a deleted project path, so let’s walk through the most likely fixes step by step:

1. Clean Up IIS Express Configuration

VS Debug often uses IIS Express under the hood, and its config files are a common culprit for stale path references:

  • Open the IIS Express config folder at %userprofile%\Documents\IISExpress\config
  • Edit the applicationhost.config file (use a text editor with admin rights if needed) and search for OurProduct_Bad-Missing-path. Delete any <site> or <application> nodes that point to this deleted path, then save the file.
  • Check the %userprofile%\Documents\IISExpress\sites folder for any XML files linked to the bad path and delete them entirely.

2. Reset Project Debug Settings in VS

Make sure your project is pointing to the correct path directly:

  • Right-click your Web project in the Solution Explorer and select Properties.
  • Go to the Web tab:
    • If using IIS Express, click the Create Virtual Directory button to ensure it maps to your current valid path (C:\inetpub\wwwroot\NetApps\AppDir\OurProduct_Release_18.1\SourceDir\LogOnScreen\LogOnScreen).
    • If using Local IIS, verify the Project URL is correct, click Validate Settings to confirm the path exists, and re-create the virtual directory if needed.
  • Delete the hidden .vs folder in your solution’s root directory (this stores VS’s debug cache), then restart VS and reload the solution.

3. Remove Stale Entries from Local IIS

If you’re using full IIS instead of IIS Express, check for leftover references:

  • Open IIS Manager by running inetmgr in the Run dialog.
  • Look in the Sites list for any site pointing to the deleted path and delete it.
  • Check the Application Pools section for any pools tied to the bad project path and remove them (double-check you’re not deleting pools for other active projects).
  • Open C:\Windows\System32\inetsrv\config\applicationHost.config (admin rights required), search for OurProduct_Bad-Missing-path, delete any related entries, then restart IIS with the iisreset command in an admin command prompt.

4. Clear VS Global Caches

If the above steps don’t work, reset VS’s user-specific cache:

  • Open an admin command prompt and run:
    devenv /resetuserdata
    
    Note: This will reset your VS customizations like keyboard shortcuts, so back up your settings first if you care about them.
  • You can also check the VS config directory at %APPDATA%\Microsoft\VisualStudio\<version> (e.g., 14.0 for VS2015, 15.0 for VS2017) for any files referencing the bad path and delete them.

5. Final Verification

After completing the steps above:

  1. Restart your computer to ensure all cached settings are cleared.
  2. Open your solution, go to Build > Clean Solution, then Build > Rebuild Solution.
  3. Intentionally add a small code error (like a syntax mistake in LogOnScreen) and start debugging. You should now see the code error directly in VS instead of the 500.19 page.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 07:29:50