Finbar Ryan on IIS and Web Development.

Please note that all of my posts are provided "AS IS" with no warranties, and confer no rights.

Debugging the “Unable to launch the IIS Express Web server.” error from Visual Studio 2012.

Debugging the “Unable to launch the IIS Express Web server.” error from Visual Studio 2012.

Rate This
  • Comments 8

Hello,

I’ve recently solved this issue on my machine and thought I would share this with everyone.

Visual Studio 2012 is configured to use IIS Express by default and on my laptop I noticed that I started to see this error.

image

So I looked at how best to resolve this issue.
Sites from Web Matrix worked fine in IIS Express and IIS Express would launch from the command line.

I started by using Process Monitor to troubleshoot this issue.

I started Process Monitor and set up a filter like this.

image

I started by looking at the Process Start event.

image


I looked at the Properties of this event and noted that the Process was starting like this.

"C:\Program Files (x86)\IIS Express\iisexpress.exe"  /config:"C:\Users\MyUserName\Documents\WebMatrix\config\config\applicationhost.config"  /site:"WebApplication2(1)" /apppool:"Clr4IntegratedAppPool"

Then I tried running this from a command prompt and see this underlying error.

”The following site was not found in the configuration file: 'WebApplication2(1)'”

So now I know that

a) My IIS Express install is using the Web Matrix Config file.

b) It can’t find the site from my Visual Studio 2012 solution.

Issue Cause.

When Visual Studio 2012 is creating the site in IIS Express it is updating the config file at C:\Users\MyUsername\Documents\IISExpress\config\ and not the Web Matrix one.

I then remembered than when I installed Web Matrix it told me it could not access the IIS Express config file and if I would like to create a new config file.

It turns out that this adds a new REG_SZ value called CustomUserHome at HKEY_CURRENT_USER\Software\Microsoft\IISExpress.
This points to the Web Matrix Config file and not the IIS Express one.

I edited this registry key to point to C:\Users\MyUsername\Documents\IISExpress and now it all works.

image

I hope this helps.

  • Unable to lounch iis web server in vs 2012 ultimate

  • I could not find the IISExpress registry entry in Windows 7.

  • Hi Sonny,

    I don't have a Windows 7 image at the moment to test against.

    I'll see if I can get one up and running and check if the registry key is there.

    Thanks,

    Finbar

  • ON THE MONEY!!!! I jus t went from a demo using Web matrix to a demo using VS 2012 and Bingo! same problem.  This fixed It THANK YOU

  • Should have updated on,  project >> Properties >> Web (tab). On Web tab you will see the choices from IIS Express 7/8 (if installed) and in Server Section Use Visual Studio Development Server.

    HTH

    Aamir Qureshi

  • super aamir

  • Aamir's technique worked perfectly and easily!

  • Hi, thanks for all of your comments on this post. I agree that switching to the Asp.Net Development Server may be an acceptable workaround for some people. The reason that we have IIS Express is an option is that it's the same engine as the full IIS Server and so offer's better fidelity when debugging Asp.Net issues. ScottGu talks more about this at weblogs.asp.net/.../introducing-iis-express.aspx

    Thanks,

    Finbar

Page 1 of 1 (8 items)
Leave a Comment
  • Please add 2 and 8 and type the answer here:
  • Post