Deploy webservice using BizTalk Deployment Framework

In one of my projects we expose schema’s as a WCF webservice. I wanted to use the BizTalk Deployment Framework to deploy the webservice along with all the other artifacts. Start by deploying the webservice using the BizTalk WCF Service Deployment Wizard. Once finished, copy the folder for the webservice from C:\inetpub\wwwroot to your project folder. After you have added the files to your project, make sure the build action on the XSD’s is set to None instead of BtsBuild, as the references in these schemas probably can’t be resolved on build. Now you have to make a couple changes in your BTDF project file. To start with, you will have to tell that you want to deploy virtual directories, change the following property to do so:


After the virtual directories have been created IIS has to be restarted. Luckily, this can also be done using BTDF, by setting the SkipIISReset property.


Next you will have to specify the settings of the webservice. For this create a new ItemGroup, which should be placed under the PropertyGroup with the ProductID.

  <VDirList Include="*">

You will also have to specify the user credentials the AppPool will run under. I used the SettingsFileGenerator.xml file for this. Add VDIR_UserName and VDIR_UserPass to this document, and set them for your environments. Now go back to the BTDF project file, and add the following under the ItemGroup you just created.

  <PropsFromEnvSettings Include="VDIR_UserName;VDIR_UserPass" />

Standard, the AppPool will be running .NET2, however we want it running .NET4. In the final release of BTDF v5 there will be a new attribute on the VDirList for this, but for now we have to use a CustomPostDeployTarget.

<Target Name="CustomPostDeployTarget">
  <Exec Command="&quot;C:\Windows\System32\inetsrv\appcmd.exe&quot; set APPPOOL /;NameOfAppPoolToRunServiceUnder&quot; /managedRuntimeVersion:v4.0 /managedPipelineMode:Integrated" />

Now when you use the BTDF to deploy your application, it will automatically set up an AppPool and create the WCF webservice for you.

1 thought on “Deploy webservice using BizTalk Deployment Framework

  1. Hi.. do you now if the depl framewrk also updates the virtual dirs? If I need to change the wsld somehow, and incorporate this change in de framework will it update the dirs?Or do Ineed to remove the vdirs through PS first?



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.