Problem
We currently have a number of BizTalk Applications under development, each has its own Solution. As we begin integrating them with Continuous Integration there will be a potential issue. Imagine the scenario where Application A and Application B both have check-ins performed at a similar time triggering the automated build for both projects. As both Applications depend on BizTalk if the build process does something to BizTalk it might cause the build of the other to fail. An example of this would be if Application B's build restarted the default BizTalk In Process Host while Application A was running its unit tests. This could cause a test in Application A to fail.
Note: It is recommended to beging using Continuous Integration as early as possible and preferably have it setup before you begin developing, but unfortunately we did not have this luxury.
Solution
At present in development we restart the Default BizTalk Windows Service. We also execute an IISReset command for BizTalk Applications which publish or interact with Web Services. We have made modifications to the setup of the applications so that they can all build at the same time without affecting other. We did the following changes:
1. Each application will have its own In Process and Isolated Host
2. The build will stop and delete the hosts during the "Clean Up" phase of the build (Note: you will need to remove your application before deleting a host)
3. The build will also Create and start the hosts in the "Setup" phase of the build
4. In the build rather than doing an IISReset we will stop and start the application pools used by each web site or virtual directory related to our application
5. We updated our binding files for development to use the new hosts.
6. We have created some MsBuild tasks which help us do this (CreateHost, DeleteHost, StartHost, StopHost, AppPoolStart, AppPoolStop)
This seems to have isolated each solution development enough in what we are doing to allow them to all build at the same time.