15

On Visual Studio 2010 + IIS Express 7 I was able to use IIS Express as a server and browse sites.

I've since installed Visual Studio 2012 (on Windows 7 64-bit) with IIS Express 8, and I can't browse a single site on it. In addition, when I look at the log files (\Logs and \TraceLogFiles) I don't even see a single log entry for any of the 2012/IISExpress 8 apps, let alone an error to look into.

Looking at applicationhost.config, I do see the site I'm trying to run with the correct path, apppool and port.

But when attempting to run it, IIS Express 8 starts, I get an unusually long pause, and then I get a can't connect error in the browser. That is, in IE9 I get "Internet Explorer cannot display the webpage," in Chrome "Oops! Google Chrome could not connect to localhost:60046"

Has anyone else run into this? Is there something I need to do to complete the configuration of IIS Express 8 with VS2012?

UPDATE Mar 2 2013

This is still unresolved but here's a list of symptoms and partial solutions.

IIS Express completely non-functional I was unable to connect to IIS Express under any conditions, originally. It turned out I had 2 problems, one relating to DNS, and the other appearing to relate to a bug in Visual Studio 2012.

Issue 1: Windows DNS I had set my Windows wifi connection to use Google's DNS servers, rather than leaving it at Automatic. This worked fine with:

  • IIS
  • Cassini (Visual Studio internal webserver)
  • Nearly anything else

It did not work with:

  • IIS Express when attempting to connect to localhost - it fails to connect, even when running IIS Express from the command line, no Visual Studio involved.

The solution was to set my DNS settings back to Automatic (and switch my router to use Google DNS instead).

Issue 2: A bug in Visual Studio 2012 Microsoft is yet to acknowledge This got me to a point where IIS Express works fine from command-line, and the only remaining issue is connecting to it from Visual Studio 2012. Cassini and IIS (not Express) from VS2012 work fine, including localhost and the same projects that fail in IIS Express.

When I attempt to run against IIS Express however, the IIS Express tray icon appears, a minute goes by where Visual Studio appears to freeze, and then the tray icon vanishes and the same error message as shown in this question appears in Visual Studio:

Debugging MVC application in VS2012 attempts to start IIS Express twice

One peculiar thing is that if I right-click that tray icon and attempt to open a browser against it during the minute freeze-up, I get the web application - it runs for that one minute and works as intended. Then it dies when Visual Studio apparently kills it.

I however can't confirm that IIS Express is running twice as in w.brian's issue. That said, this may be the exact same Visual Studio 2012 bug just showing very slightly different symptoms.

Microsoft bugs and paywall I've reported the issue to Microsoft. They began diagnosing it with me, but then told me I'd need to pay $250 to continue - something I'm not prepared to do to help them fix their bugs.

There are several bug reports on this:

My original bug report: http://connect.microsoft.com/VisualStudio/feedback/details/766233/

A second one they had me open to navigate the bureaucracy: http://connect.microsoft.com/VisualStudio/feedback/details/779161/

w.brian's bug report: https://connect.microsoft.com/VisualStudio/feedback/details/778864/

But I suspect this is all the same bug that Microsoft is ignoring with a paywall between its customers and them, preventing them from actually gathering enough detail to recognize there's a bug here.

With Microsoft wasting enough of my time I've moved on to just using regular IIS as a workaround.

That's the absolute latest. Sorry everyone.

Update 8/2013: The machine that was experiencing this issue has since died (spilled something on it), and my new machine doesn't have this issue. I've suggested to Microsoft they reach out to others here with this issue. It may make sense to comment here if you're still experiencing the problem so they know how to contact you. And remember you can edit StackOverflow questions, so you can always just update this question yourself with more diagnosis information.

Community
  • 1
  • 1
Chris Moschini
  • 36,764
  • 19
  • 160
  • 190
  • Have you ever got it to work? I encountered a similar problem. – user523234 Dec 26 '12 at 14:14
  • 1
    I opened a ticket with Microsoft and we solved half the problem, but are yet to fully resolve it. I'll add my answer here if we get it fully solved (rather than posting a half-baked answer). One notable issue though was that I was using Google DNS in my wifi settings which was impairing IE's ability to resolve localhost. An oddity of Windows. I shifted the DNS entry to my router to resolve this portion of the issue (IIS Express issue still unresolved however). – Chris Moschini Dec 26 '12 at 22:36
  • Chris, I've encountered something similar. I posted a pretty detailed question here: http://stackoverflow.com/questions/14762646/debugging-mvc-application-in-vs2012-attempts-to-start-iis-express-twice Is this the same issue you're having? If so, I think I can shed a little more light on the issue, although I'm also still looking for a solution. – w.brian Feb 08 '13 at 22:10
  • I am certain this is a Visual Studio 2012 bug. I posted a similar, more detailed question here: http://stackoverflow.com/questions/14762646/ I have also filed a bug ticket with Microsoft here: http://connect.microsoft.com/VisualStudio/feedback/details/778864/ If you believe this is the same problem you are having, please go to the bug ticket and vote it up. – w.brian Feb 08 '13 at 22:43
  • In working with Microsoft to resolve the issue (not yet resolved), IIS Express also failed to start on my machine running from the command-line without Visual Studio 2012 running, so these may be separate issues. – Chris Moschini Feb 09 '13 at 20:52
  • Microsoft has closed this ticket saying I need to pay $260 to continue - not worth it to me. Interested in answers by others with this issue willing to navigate the MS bureaucracy. – Chris Moschini Feb 13 '13 at 22:01
  • I was ultimately able to get IIS Express to start from the command-line with the above resolved issue, so starting from VS2012 is the core issue now. However it's not the same as w.brian's issue - in procmon I see iisexpress.exe start just the once, Visual Studio attempt TCP Connect to it repeatedly for 30 seconds, then kill iisexpress.exe with a message from Visual Studio saying it couldn't start IIS Express. – Chris Moschini Feb 13 '13 at 22:27
  • Chris, did you ever figure out a solution to your problem? I'm having the same issue. – Evan Larsen Mar 01 '13 at 20:22
  • Same issue here with a fresh install of VS2012 or VS2010. – ardila May 29 '13 at 13:32

6 Answers6

4

I tracked down the problem on my machine.

When I checked my C:\Windows\system32\drivers\etc\hosts file, I did not have

 127.0.0.1   localhost

in the file. I remember changing it "temporarily" to troubleshoot a problem. Adding back in the missing record fixed my problem.

You can test what IP your machine thinks localhost is by simply ping localhost and making sure that 127.0.0.1 is pinged and not some other IP.

Wayne Arthurton
  • 643
  • 1
  • 6
  • 22
1

Did you check if the http bindings registration happened for your site? (running "netsh http show servicestate" command from command prompt would show all the registered bindings and check if your site binding "localhost:60046" exists or not)

if your site binding does not exists, try following to check why bindings registration is failing.

  1. Open command prompt
  2. Goto IIS Express installation folder (%programfiles%\iis express)
  3. Start your site from command line by using following command line iisexpress.exe /site:"your-site-name" /trace:d
  4. Step 3 would show error message if the bindings registration fails
vikomall
  • 17,379
  • 6
  • 49
  • 39
  • 1
    Thanks for the suggestion. To narrow the issue, I have a folder with a single index.html in it I'm running directly against, like: C:\Program Files\IIS Express>iisexpress.exe /path:"C:\Users\Chris\Code\JustCode\iisexpresstest" /port:8080 /trace:d This DID in fact produce an error! ...But I really don't know what it means. "Inetinfo: Failed reading registry value 3704 iisutil!ReadMultiStringParameterValueFromAnyService [helpfunc.cxx @ 490]:Inetinfo: Failed reading registry value Error(80070002): The system cannot find the file specified." – Chris Moschini Oct 14 '12 at 21:11
  • Post complete error message... You can ignore this error message. – vikomall Oct 15 '12 at 04:51
  • Unfortunately that is in fact the entire error message. I get no other errors, including when I then attempt to connect to http://localhost:8080/ - I get cannot connect as above in the browser, but no new output in the command window where iisexpress is running. – Chris Moschini Oct 16 '12 at 10:15
  • Chris did you ever figure out the solution to your problem? I'm having the same issue. – Evan Larsen Mar 01 '13 at 20:21
  • @ChrisMoschini did you manage to solve your issues? I have exactly the same error message. – Tom Lint Jul 09 '13 at 12:14
  • Microsoft ultimately asked me to pay large support fees to get any farther. The machine with the issue eventually died, and I bought a new computer that isn't currently having this problem. – Chris Moschini Jul 09 '13 at 16:12
1

I had a similar issue running my asp.net MVC4 project on localhost under IIS express 8.0 so I ended up uninstalling IIS 8.0 and installing IIS express 7.5 and straight away the problem was fixed:

IIS Express 8.0 seems to be installed with VS 2012 so if you had a new install or possibly a service pack update this might have upgraded your previous IIS express version.

Ciarán Bruen
  • 5,221
  • 13
  • 59
  • 69
  • Worked for me even for IIS 8 when I uninstalled it first, then deleted My Documents\IISExpress folder and reinstalled IIS 8. Solved my problem of months. Thanks. God bless you! – Aditya Bokade Dec 23 '14 at 18:57
1

I resolved my issues with IIS by installing WebMatrix (download). I ran WebMatrix, opened a site in WebMatrix and IIS fired up just fine. Closed WebMatrix and ran an ASP.NET MVC site in VS and it worked.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Dylan
  • 11
  • 2
0

I know this question was answered by the original poster, but for those who get here through google, here is a possible solution to your problems: HTTPS stopped working with IIS express

Community
  • 1
  • 1
brudert
  • 537
  • 8
  • 21
0

If anyone else has this issue - make sure any website bindings in applicationhost.config refer to valid addresses.

I had this message when applicationhost.config was binding to a specific IP address, but that IP wasn’t valid for the host at that time (I had an internal network IP assigned via a DHCP reservation, but I was on a different network).

Sam
  • 4,694
  • 2
  • 36
  • 47