title: WCF: multiple services in one project hosted on IIS, but different permissions?
body: <p>I have an existing app and need to expose parts of it to the outside world, with different services for different clients.<br>
  To be precise, it is already running with one WCF service and now I need to add a second service, totally unrelated to the first one, to be consumed by a totally different client.</p>
  
  <p>When I created the existing service, I added a WCF Service Project to our existing solution, and then I created a new "WCF Service" and edited that.<br>
  So, in Visual Studio, the folder layout looks like that:</p>
  
  <pre><code>\MyServiceProject\IMyFirstService.cs
  \MyServiceProject\MyFirstService.cs
  \MyServiceProject\MyFirstService.csproj
  \MyServiceProject\MyFirstService.svc
  \MyServiceProject\Web.config
  </code></pre>
  
  <p>We have a build script that compiles stuff and copies files, and then the published folder on IIS looks like that:</p>
  
  <pre><code>\MyFirstService\bin\MyServiceProject.dll
  \MyFirstService\MyFirstService.svc
  \MyFirstService\Web.config
  </code></pre>
  
  <p><em>(if I recall it correctly, it only worked when the DLL was in a subfolder named "bin", hence the copying in the build script)</em></p>
  
  <p>Now I want to add another .svc file.<br>
  I would prefer to avoid having to create a second WCF Service project...I would like to add the new service to the existing project instead.</p>
  
  <p>BUT: The second service needs to have different permissions than the first one (restricted outside access, but to different clients...).<br>
  According to our admin, I have to put the second service in a second folder so we can give it different permissions.<br>
  So the deployed services would have to look like this:</p>
  
  <pre><code>\MyFirstService\MyFirstService.svc
  \MySecondService\MySecondService.svc
  </code></pre>
  
  <p>But that would also mean that the other files would have to be duplicated:</p>
  
  <pre><code>\MyFirstService\bin\MyServiceProject.dll
  \MyFirstService\Web.config
  \MySecondService\bin\MyServiceProject.dll
  \MySecondService\Web.config
  </code></pre>
  
  <p>I don't care about duplicating MyServiceProject.dll, but what about the Web.config?<br>
  There's only one in Visual Studio, and if I want to run the services in debug mode, I have to add both services to it.<br>
  Or can I somehow split the web.config, so that it works in Visual Studio (when both services are in the same folder) and deployed on IIS (where each service has its own folder)?</p>
  
  <p>Any idea how to solve this?<br>
  Or am I doing something completely wrong? This WCF stuff is all new to me, and everything I did so far was hacked together with help from Google...</p>