Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET 5 MVC: unable to connect to web server 'IIS Express'

What I'm doing:

  • Opening Visual Studio Community 2015
  • File -> New -> Project
  • Under Visual C#: Web -> ASP.NET Web Application
  • Web Application
  • And press f5 for the popup error "unable to connect to web server 'IIS Express'."

Deleting applicationhost.config, located in Documents\IISExpress\config, doesn't change the error message. (There's also an IISExpress folder in program files and program files (x86).)

Something I noticed, and I don't know if it's a problem:

Referenced file 'lib/jquery-validation/jquery.validate.js' not found.

I got a dump with rawcap but I don't notice much in there. Some of what was there:

"Framework":{"FrameworkName":"DNXCore,Version=v5.0","FriendlyName":"DNX Core 5.0","ShortName":"dnxcore50","RedistListPath":null}

I don't notice a problem, but I have the network data if that can help figure out why I cannot connect to the web server. I get a RST,ACK immediately so I'm guessing the port is closed and whatever this web server is, isn't being setup.

More on this problem: 800700c1 error from /trace:error

I've tried:

  • deleting applicationhost.config (and changing port number)
  • running visual studio as administrator
  • deleting IISExpress folder in Documents (changes error message until the folder is reinstalled)
  • toggling ssl off and on, copying url to launch box. (note: I'm not using ssl)
  • clearing all sfc /scannow errors
  • starting iisexpress with x86 version and 64-bit version
like image 981
Sarek Avatar asked Feb 27 '16 21:02

Sarek


People also ask

How do I enable IIS Express in Visual Studio?

Configure IIS express on visual studioSelect the web application project and open properties -> select the web tab -> under server's select IIS express-> Specify the project URL. Now open the project folder and . vs folder (Hidden) -> Config -> applicationhost.


2 Answers

After installing Update 2 for Visual Studio 2015 I started getting the same error. I tried everything above with no luck. However, I found a solution that works for me:

  1. Delete YourSolutionFolder\\.vs\config\applicationhost.config file (note: .vs is a hidden folder)
  2. Open Visual Studio, right-click on web site > Properties > Debug tab > Web Server Settings > App URL - change port number.

If you have IIS configured to use the same port, (stop the application / use different port) and try again.

like image 67
Victor Stagurov Avatar answered Oct 13 '22 11:10

Victor Stagurov


Exit VS and delete the (project)\.vs\applicationhost.config file. Restart VS. It should start working.

like image 39
dwoodard Avatar answered Oct 13 '22 10:10

dwoodard