The project opened yesterday is normal. The following error occurs when the project is opened today. The error message box is ASP. net Development Server failed to start listening for port XXXXX In a way that access permissions are not allowed to make an attempt to access the socket. then, the localhost Web server of Visual Studio cannot be connected.
Search Baidu
Solution:
1.[Tools]-> [External tools]-> press [add] And Enter: 1) Title: Web server port: 8081 2) command: C:/Windows/Microsoft. net/framework/v2.0.50727/webdev. webserver. EXE 3) parameter:/port: 8081/path: $ (projectdir) 4) [Use Output Window] select 2. click the "Web server port: 8081" option displayed on the "Tools" menu to activate the custom web server. After activation, an "Asp.net developserver" icon appears in the lower right corner of the window. 3. Right-click the website and choose "property page"> "launch options"> "use custom server". Enter http: // localhost: 8081 in the base URL.
4.Remember to change the running port on the IIS of the website or project to 8081: IIS -- find your project website and right-click and change the port to 8081, there are many other methods.
In short, it really screwed me up.
Later, I thought the problem may be that the port used earlier was blocked. Changing a port should solve the problem, but far from using the method of external tools. In the project file (SLN), this port is actually defined. You can simply open it in notepad and change it to another port.