Deploy services to two different sites

Topics: IIS and Web Services
Jun 28, 2013 at 3:16 PM
I'm trying to help someone set up a deployment that involves two web services. They want one service to go in the default web site and the other to go in a different site. Is there a way to this with the built in functionality of BTDF?

I understand using IISMetabasePath to change the target website, but that changes it for everything. Is there a way to use one IISMetabasePath for one service and a different one for a second service in the same BTDF project?

Thanks
Coordinator
Jul 1, 2013 at 6:22 AM
You could give this a try in your .btdfproj:
<Target Name="Deploy2ndWebService" AfterTargets="DeployVDirs">
   <CreateProperty Value="IIS://localhost/w3svc/2/Root">
      <Output TaskParameter="Value" PropertyName="IISMetabasePath" />
   </CreateProperty>

   <CreateItem
       Include="*" AdditionalMetadata="Vdir=MyVDir;Physdir=..\OtherWebService;AppPool=DefaultAppPool">
      <Output TaskParameter="Include" ItemName="VDirList"/>
   </CreateItem>

   <CallTarget Targets="DeployVDirs" />
</Target>
The idea being that the normal built-in process runs first, then this custom target runs. It overrides the IISMetabasePath and VDirList, then calls DeployVDirs again but this time the new values should be in effect.

This is completely untested, but it seems like it should work...

Thanks,
Tom