ASP.NET应用启动时IIS Express重复启动站点及端点实例问题求助
Hey there, sorry to hear you're stuck with this frustrating IIS Express behavior—duplicate instances and failed startups are the worst. Let's go through tried-and-true fixes that usually get things back on track:
Over time, IIS Express stores cached site settings that can get corrupted or stuck, leading to duplicate launches. Here's how to clear them:
- Delete the main IIS Express config folder: Navigate to
%userprofile%\Documents\IISExpressand delete the whole folder. Don't worry—Visual Studio will rebuild a fresh set of configs the next time you launch your project. - Remove the project-specific
.vsfolder: This hidden folder lives in your ASP.NET project's root directory. It holds project-specific IIS Express settings that can go haywire. Close Visual Studio first, then delete the.vsfolder.
Sometimes the issue is just a misconfigured launch profile causing VS to spin up multiple instances:
- Open your project's Properties > Debug tab:
- Make sure the Launch dropdown is set to only one option (either
IIS Expressor your project name—not both accidentally enabled) - Verify the App URL and SSL URL don't have conflicting ports. If you see a port conflict, change the port number (you can do this by clicking "Create Virtual Directory" or editing the
launchSettings.jsonfile directly)
- Make sure the Launch dropdown is set to only one option (either
- Open
Properties/launchSettings.jsonmanually: Scan for duplicate profiles or duplicate endpoint entries. If you see two profiles set to launch by default, remove the extra one or set a single default.
Leftover IIS Express processes often hang around and conflict with new launches. Let's clean them up:
- Open Task Manager (Ctrl+Shift+Esc), go to the Details tab, find all
iisexpress.exeentries, and end each one. - Or use Command Prompt to kill them all in one go:
taskkill /F /IM iisexpress.exe
This ensures you're starting with a clean slate before launching your project again.
Some VS debug features can accidentally trigger duplicate instances:
- Go to
Tools>Options>Debugging>General:- Uncheck Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE) if you don't need it. This feature sometimes causes extra instances to spin up, especially with HTTPS endpoints.
- Check
Tools>Options>Projects and Solutions>Web Projects:- Make sure Use the 64-bit version of IIS Express for web sites and projects matches your project's target platform. If you're targeting x86, uncheck this; if x64, check it. Mismatched settings can lead to unexpected duplicate instances.
If all else fails, the IIS Express installation itself might be corrupted:
- Go to Control Panel > Programs and Features, find IIS Express, right-click it, and select Repair.
- If repair doesn't fix it, uninstall IIS Express completely, then download and install the latest version from Microsoft's official channels.
内容的提问来源于stack exchange,提问作者Алексей Соломонов

