Search code examples
visual-studio-2010configurationiis-express

How to run multipe WCF services using the same IIS Express instance through VS 2010


I have a solution in Visual Studio 2010 with multiple WCF service projects, which I would like to run under IIS Express as a single site with a subfolder containing each WCF project:

Web site
   /WCF-project1
   /WCF-project2
   /WCF-project3

I reckon I need to configure each project (Project->Properties->Web->Servers) in Visual Studio 2010 as well as the IIS Express configuration (applicationhost.config) ... any ideas?


Solution

    1. Create a Web Application in Visual Studio (I named it as 'RootApp')
    2. Configure it to use 'IIS Express'
    3. Now open applicationhost.config file (%userprofile%\documents\iisexpress\config\applicationhost.config)
    4. Locate the WWeb Application created in step1 ('RootApp') and edit as shown below.

          <site name="RootApp" id="123">
              <application path="/" >
                  <virtualDirectory path="/" physicalPath="Root app path" />
              </application>
              <application path="/app1" >
                  <virtualDirectory path="/" physicalPath="wcf project1 path" />
              </application>
              <application path="/app2" >
                  <virtualDirectory path="/" physicalPath="wcf project2 path" />
              </application>
              <application path="/app3" >
                  <virtualDirectory path="/" physicalPath="wcf project3 path" />
              </application>
              <application path="/app4" >
                  <virtualDirectory path="/" physicalPath="wcf project4 path" />
              </application>
              <bindings>
                  <binding protocol="http" bindingInformation="*:57366:localhost" />
              </bindings>
          </site>