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条回答
可以哭但决不认输i
2楼-- · 2019-01-03 04:52

I had the same problem with VS 2013 and even after all possible tries it was not working.My problem was solved by:

- In control panel (Program and Features) I found that all of the IIS related features were unchecked.I finally checked all of those and restarted my system.
- Then I started my VS 2013 as administrator and thats it everything
   worked fine then.

At least you can give this a try since it worked for me.

查看更多
成全新的幸福
3楼-- · 2019-01-03 04:52

I had a similar problem when running my solution from VS2012:

Unable to launch the IIS Express Web server.  
The start URL specified is not valid. https://localhost:44301/

I had the incorrect project selected as Startup Project. I made the Cloud project the Startup (right click on project -> Set as Startup Project) and everything started working fine.

查看更多
贼婆χ
4楼-- · 2019-01-03 04:54

There is no need to delete the entire IISExpress folder in the directory C:\Users[you]\Documents\IISExpress.

Just comment:

<binding protocol="https" bindingInformation="*:8090:localhost" />

in the applicationhost.config file in the IISExpress folder.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-01-03 04:55

@roblll had it right. But for those of you who didn't want to dig for the answer, here it is:

  1. Close Visual Studio (might not be necessary, but it won't hurt).
  2. Navigate to your Documents folder. This is where my IISExpress configuration directory was.
  3. In the config folder, there is a file called applicationhost. Open that.
  4. Search for the name of your project. It should have been added in there by Visual Studio when it bombed in your previous attempts.
  5. Note that there's a binding for http with the port you intend to use for https.

    //Change this:
    <binding protocol="http" bindingInformation="*:44300:localhost" />
    
    //to this:
    <binding protocol="https" bindingInformation="*:44300:localhost" />
    

Keep in mind, Visual Studio might have supplied different ports than you expected. Just make sure that the ports in the binding correspond to what's in the Web tab of your project's properties.

http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx

查看更多
Ridiculous、
6楼-- · 2019-01-03 04:57

In my case the project was on network drive and deleting IIS Express folder didn't help as described in other answers. My workaround was copying the project to local drive and it worked!

查看更多
爷的心禁止访问
7楼-- · 2019-01-03 04:57

I had the same problem, thanks to @Jacob for giving information about it.

The Reason is - wrong entry for your project in config file applicationhost located at

C:\Users\(yourusername)\Documents\IISExpress\config 
  1. Close all Visual Studio solutions.
  2. Rename IISExpress folder to some IISExpress-Copy (instead of deleting you can have a copy of it)
  3. Now open VS again and build/debug the project, now you would see IISExpress folder created for you again with correct configuration.

It worked for me and hope it should work for you also.

查看更多
登录 后发表回答