Visual Studio 2017创建ASP.NET MVC项目启动超时求助
Hey there, sorry to hear you're stuck with this timeout issue right after creating a fresh ASP.NET MVC project in Visual Studio 2017—no one wants to hit roadblocks before even writing a line of code. Let's go through some tried-and-true fixes that usually get things back on track:
Check for port conflicts
The portxxxxxyour project is trying to use might be occupied by another app. Open Command Prompt as administrator and run this command to find the process hogging the port:netstat -ano | findstr :xxxxxNote down the PID number from the result, open Task Manager, head to the Details tab, locate the process with that PID, end it, then restart VS and try running your project again.
Switch to a different port
If ending the conflicting process isn't feasible, just change the project's debug port:- Right-click your project in Solution Explorer → select Properties
- Navigate to the Web tab
- Under Server, tweak the port number in the Project URL field (e.g., change
http://localhost:xxxxx/tohttp://localhost:5000/) - Save changes and launch the project again
Reset IIS Express
Corrupted IIS Express configuration or cache can often cause this issue. Here's how to reset it:- Open Command Prompt and run:
iisexpress /stop - Go to
%USERPROFILE%\Documents\IISExpressand delete all contents inside this folder - Restart Visual Studio and try launching your project once more
- Open Command Prompt and run:
Disable SSL temporarily
Auto-enabled SSL can trigger timeout issues if there's a problem with the local certificate. Try turning it off:- Go to your project's Properties → Web tab
- Uncheck the Enable SSL checkbox
- Update the Project URL to use
httpinstead ofhttpsif needed, save changes, and run the project
Repair Visual Studio 2017
If none of the above works, there might be a corrupted component in your VS installation:- Open Control Panel → Programs and Features
- Find Microsoft Visual Studio 2017 in the list, right-click it → select Change
- Choose the Repair option and wait for the process to finish
- Restart your computer and try creating/running the project again
Check firewall/antivirus settings
Your firewall or antivirus software might be blocking Visual Studio from establishing a connection. Try temporarily disabling them (just for testing) or add Visual Studio to their trusted applications list, then see if the project runs successfully.
内容的提问来源于stack exchange,提问作者user9335731

