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:
It did not work with:
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.
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. This worked for me.
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.
Open the control panel and try to uninstall IIS express first. Then download IIS Express from this link. If it still cannot work, please open visual studio installer and repair it. VS will reset all environment path and variables.
The 32 bit version can be found at c:\program files (x86)\IIS Express\iisexpress.exe and the 64 bit version can be found at c:\program files\IIS Express\iisexpress.exe . IIS Express ignores the enable32BitAppOnWin64 attribute. To run the app pool as 32 bit, you must execute the 32 bit version of IIS Express.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With