Unable to launch the IIS Express Web server

2019-01-03 04:14发布

I have an asp.net MVC 4 solution. When I try to open it using Visual studio 2012, I get following error:

Microsoft Visual Studio

Configuring Web https://localhost: for ASP.NET 4.5 failed. You must manually configure this site for ASP.NET 4.5 in order for the site to run correctly. Could not find the server https://localhost:44300/ on the local machine. Make sure the local IIS server has been configured to support secure communications.

OK Help

Although the solution opens. Also, When I try to run it from debug menu, I get following error:

 Unable to launch the IIS Express Web server.

The start URL specified is not valid. https://localhost:44300/

and I can not debug the code. how to get rid of these errors and debug/run the web site from VS 2012 ?

Please suggest.


30条回答
The star\"
2楼-- · 2019-01-03 04:40

Try following steps:

  1. delete the IISExpress folder as @Yehuda Shapira said
  2. restart computer
  3. delete the .vs folder in project

Have a good luck!

查看更多
疯言疯语
3楼-- · 2019-01-03 04:42

If using VS2015 or above

Make sure iisexpress process is not running.

Make sure no other process is using your desired port. You can do that by executing netstat -a -b in the console (as Administrator).

Then delete the following file

<<path_to_solution_folder>>\.vs\config\applicationhost.config

note the .vs folder may be hidden

then find <<project-name>>.csproj.user file, open it with text editor (notepad) and make sure IISUrl under WebProjectProperties is configured to <IISUrl>http://localhost:XXXXX/</IISUrl> where XXXXX is your desired port.

after doing this and trying to start the app you may get

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Then go to {Project Properties} -> Web and Press the "Create Virtual Directory" button

enter image description here

查看更多
干净又极端
4楼-- · 2019-01-03 04:43

I had the exact same problem.
The reason - bad IIS config file.

Try deleting the automatically-created IISExpress folder, which is usually located at %userprofile%/Documents, e.g. C:\Users\[you]\Documents\IISExpress.

Don't worry, VS should create it again - correctly, this time - once you run your solution again.


EDIT: Command line for deleting the folder:

rmdir /s /q "%userprofile%\Documents\IISExpress"
查看更多
不美不萌又怎样
5楼-- · 2019-01-03 04:44

I had the same problem after installing Visual Studio 2013 Update 3.
VS 2013 can not load Microsoft.VisualStudio.TraceLogPackage.dll
Unable to launch the IIS Express Web server

My problem solved by doing the following steps :

1. Repair Visual Studio 2013 Update 3
2. Start the Developer Command Prompt as administrator.
3. Type devenv.exe /setup then press enter

查看更多
你好瞎i
6楼-- · 2019-01-03 04:44

I had the same issue. I had deleted a lot of folders under C:/users/ path to free some space on my machine. After which I started getting this error.

I just had to restart my machine and it all worked fine.

查看更多
戒情不戒烟
7楼-- · 2019-01-03 04:46

In my case after I allowed external request to my IIS Express website and configured windows firewall to allow iisexpress.exe, I can't start it from within Visual Studio 2013. I can still start it with command line, and it serves local and external requests well.

C:\Program Files (x86)\IIS Express>iisexpress /site:MyWebSiteName

I tried to create a firewall rule to allow my port, after that VS worked.

查看更多
登录 后发表回答