Search code examples
visual-studioiis-express

How to solve "Microsoft Visual Studio (VS)" error "Unable to launch the IIS Express Web server"


PROBLEM

In some cases "Microsoft Visual Studio (VS)" when you use "Microsoft Internet Information Services Express (IIS)" and you have attached web site project to IIS after run Build shown this error message

Unable to launch the IIS Express Web server.

How can I solve it if exception message does not shown nothing more?


Solution

  • Pre-Requirements

    The best step is catch what exactly is going on.

    1. Download and use for it "Sysinternals Process Monitor (PM)".

    2. Run PM and create filter 'Process Name' 'is' 'iisexpress.exe'. Now you show capture events only from IIS.

    3. Run building your VS project with key F5 and watch PM results.

    4. Open with double click first row with Operation = Process Start and look detail for full parameters to run IIS especially "Command line".

    5. Open "Command Line Interface (CLI)" called "Command shell" with Win+R write "cmd" put IIS command line value and run with Enter. Now you see the exact error:

       "C:\Program Files\IIS Express\iisexpress.exe"  /config:"C:\Users\{user_name}\Documents\IISExpress\config\applicationhost.config"  /site:"{project_name}" /apppool:"Clr4IntegratedAppPool"
      

    SOLUTION

    Case "apppool"

    The following switch requires a value: apppool

    1. Open file

       %userprofile%\documents\iisexpress\config\applicationhost.config`
      
    2. Find in section sites > site your named project or by bindingInformation by attached from VS. Add to section application another parameter applicationPool from version what you use for your project.

       <application path="/" applicationPool="Clr4IntegratedAppPool">
      
    3. Now test it, close fully VS, open project again and build.

    Case "config"

    1. "Remove WebMatrix" or "Create symlink" or replace it on that place.

    Ref