SkipHostInstancesRestart Bug?

Topics: Server Deployment
May 2, 2014 at 5:00 PM
I'm using BTDF 5.5

I'm using this option and I noticed that the package will sometimes still restart Host Instances when undeploying.

Also, when deploying/undeploying to/from a non-last BizTalk server (just into GAC) I noticed that the package is still sometimes stopping and restarting Host Instances. It shouldn't need to do that, right?

Here's an example of an undeploy from a non-last server:
Build started 5/2/2014 4:48:06 PM.
__________________________________________________
Project "C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\Deployment.btdfproj" (Undeploy target(s)):

Target Undeploy:
    Target SetModeUndeploy:
        UNDEPLOYING APPLICATION FROM BIZTALK...
    Target ServerUndeploy:
        Target SetWinVer:
            Running on Windows V61
            Detected IIS 7
            Detected 64-bit OS
        Target GetSoftwarePaths:
            Using .NET Framework Install Path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
            Using BizTalk Install Path 'D:\Program Files (x86)\Microsoft BizTalk Server 2013\'.
            Using Deployment Framework Install Path 'C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\'.
            Using Deployment Framework Tools Path 'C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\Framework\DeployTools'.
        Target ExportSettings:
            "C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\Framework\DeployTools\EnvironmentSettingsExporter.exe" "C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\EnvironmentSettings\SettingsFileGenerator.xml" "C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\EnvironmentSettings"
            Environment Settings Spreadsheet to XML Exporter 1.6.1
            [http://EnvSettingsManager.codeplex.com]
            Copyright (C) 2007-11 Thomas F. Abraham.  All Rights Reserved.
            
            Importing from SettingsFileGenerator.xml...
            
            Output format is XmlPreprocess (multi-file).
            
            Exporting to Exported_LocalSettings.xml...
            Exporting to Exported_DevSettings.xml...
            Exporting to Exported_SteSettings.xml...
            Exporting to Exported_StgSettings.xml...
            Exporting to Exported_PrdSettings.xml...
            Exporting to Exported_PefSettings.xml...
            
            Finished.
        Target InitSettingsFilePath:
            Using settings file \\gcmsDEVconfig\DEV_config$\MasterSettings_DEV.xml
        Target SetPropertiesFromEnvironmentSettings:
            Setting properties from environment settings file (\\gcmsDEVconfig\DEV_config$\MasterSettings_DEV.xml)
            Setting property to value 'APPS\APPS-GCMS-DEV BizTalk Application User'.
            Setting property to value 'APPS\APPS-GCMS-DEV BizTalk Application Administrator'.
        Target InitializeAppName:
            BizTalk Application Name is CIC.GCMS.Common.CLR.Out
        Target StopBizTalk:
            Target StopAllBizTalkHosts:
                Host list (BizTalkHosts ItemGroup) not customized.
                Host instance BiDiClusteredHost_MSMQ has cluster type Clustered.
                Querying localhost to request active cluster node...
                Active cluster node reported by localhost is NJES1S7334.
                Skipping passive clustered host instance: BiDiClusteredHost_MSMQ on NJES1S7333
                Host instance BiDiClusteredHost_MSMQ has cluster type ClusteredVirtual.
                Stopping host instance: BiDiClusteredHost_MSMQ on NJES1S7334
                Stopped host instance : BiDiClusteredHost_MSMQ on NJES1S7334
                Host instance ReceivingClusteredHost has cluster type Clustered.
                Skipping passive clustered host instance: ReceivingClusteredHost on NJES1S7333
                Host instance ReceivingClusteredHost has cluster type ClusteredVirtual.
                Host instance BiDiClusteredHost_FTP has cluster type Clustered.
                Skipping passive clustered host instance: BiDiClusteredHost_FTP on NJES1S7333
                Host instance BiDiClusteredHost_FTP has cluster type ClusteredVirtual.
                Stopping host instance: BiDiClusteredHost_FTP on NJES1S7334
                Stopped host instance : BiDiClusteredHost_FTP on NJES1S7334
                Stopping host instance: IsolatedHost on NJES1S7333
                Stopped host instance : IsolatedHost on NJES1S7333
                Stopping host instance: IsolatedHost on NJES1S7334
                Stopped host instance : IsolatedHost on NJES1S7334
                Stopping host instance: TrackingHost on NJES1S7333
                Stopped host instance : TrackingHost on NJES1S7333
                Stopping host instance: TrackingHost on NJES1S7334
                Stopped host instance : TrackingHost on NJES1S7334
                Host instance BiDiClusteredHost_MQSeries has cluster type Clustered.
                Skipping passive clustered host instance: BiDiClusteredHost_MQSeries on NJES1S7333
                Host instance BiDiClusteredHost_MQSeries has cluster type ClusteredVirtual.
                Stopping host instance: ProcessingHost_FOSSCLR on NJES1S7333
                Stopped host instance : ProcessingHost_FOSSCLR on NJES1S7333
                Stopping host instance: ProcessingHost_FOSSCLR on NJES1S7334
                Stopped host instance : ProcessingHost_FOSSCLR on NJES1S7334
                Stopping host instance: ProcessingHost_ICFLoad on NJES1S7333
                Stopped host instance : ProcessingHost_ICFLoad on NJES1S7333
                Stopping host instance: ProcessingHost_ICFLoad on NJES1S7334
                Stopped host instance : ProcessingHost_ICFLoad on NJES1S7334
                Stopping host instance: ProcessingHost_CPIC on NJES1S7333
                Stopped host instance : ProcessingHost_CPIC on NJES1S7333
                Stopping host instance: ProcessingHost_CPIC on NJES1S7334
                Stopped host instance : ProcessingHost_CPIC on NJES1S7334
                Stopping host instance: ProcessingHost_NRAC on NJES1S7333
                Stopped host instance : ProcessingHost_NRAC on NJES1S7333
                Stopping host instance: ProcessingHost_NRAC on NJES1S7334
                Stopped host instance : ProcessingHost_NRAC on NJES1S7334
        Target UndeployBizTalkMgmtDB_false:
            Adding assembly name 'CIC.GCMS.Common.CLR.Out.Schemas, Version=6.0.0.0, Culture=neutral, PublicKeyToken=882173aba75853b0' to item group.
            "C:\Program Files (x86)\GCMS Interfaces\CIC.GCMS.Common.CLR.Out\Deployment\Framework\DeployTools\gacutil.exe" /u "CIC.GCMS.Common.CLR.Out.Schemas, Version=6.0.0.0, Culture=neutral, PublicKeyToken=882173aba75853b0"
            Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.1
            Copyright (c) Microsoft Corporation.  All rights reserved.
            
            
            Assembly: CIC.GCMS.Common.CLR.Out.Schemas, Version=6.0.0.0, Culture=neutral, PublicKeyToken=882173aba75853b0, processorArchitecture=MSIL
            Uninstalled: CIC.GCMS.Common.CLR.Out.Schemas, Version=6.0.0.0, Culture=neutral, PublicKeyToken=882173aba75853b0, processorArchitecture=MSIL
            Number of assemblies uninstalled = 1 
            Number of failures = 0

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:02.22
May 2, 2014 at 5:01 PM
By the way, this is happening with multiple packages.

Here's one of my Deployment.btdfproj files:
<?xml version="1.0" encoding="utf-8"?>
<!-- 
  Deployment Framework for BizTalk
  Copyright (C) 2008-14 Thomas F. Abraham, 2004-08 Scott Colestock
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Installer" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
    <Platform Condition="'$(Platform)' == ''">x86</Platform>
    <SchemaVersion>1.0</SchemaVersion>
    <ProjectName>CIC.GCMS.Common.CLR.Out</ProjectName>
    <ProjectVersion>6.0.0.0</ProjectVersion>

    <IncludeSSO>True</IncludeSSO>
    <IncludeTransforms>False</IncludeTransforms>
    <IncludeComponents>False</IncludeComponents>
    <IncludeSchemas>True</IncludeSchemas>
    <IncludeOrchestrations>False</IncludeOrchestrations>
    <UsingMasterBindings>True</UsingMasterBindings>
    <RequireXmlPreprocessDirectives>False</RequireXmlPreprocessDirectives>
    <ApplyXmlEscape>True</ApplyXmlEscape>
    <SkipIISReset>True</SkipIISReset>
    <SkipHostInstancesRestart>True</SkipHostInstancesRestart>
    <WixProjectFile>GenericBizTalkMSI.wxs</WixProjectFile>
    <MsiName>CIC.GCMS.Common.CLR.Out</MsiName>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Properties related to building an MSI for server deployments -->
    <!-- BizTalk App Version Upgrade -->
    <!--   For each new product release to be deployed to your BizTalk servers: -->
    <!--     1) Increment ProductVersion -->
    <!--     2) Generate a new GUID and update ProductId with the new GUID -->
    <!--   This allows the new MSI to automatically uninstall (not undeploy!) the old MSI and install the new one. -->
    <ProductVersion>6.0.0.0</ProductVersion>
    <ProductId>734b7084-ba69-4962-b5e2-9d5f47d50482</ProductId>
    <!-- BizTalk App Version Upgrade -->
    <ProductName>CIC.GCMS.Common.CLR.Out</ProductName>
    <Manufacturer>Deployment Framework User</Manufacturer>
    <PackageDescription>CIC.GCMS.Common.CLR.Out</PackageDescription>
    <PackageComments>CIC.GCMS.Common.CLR.Out</PackageComments>
    <!-- NEVER change the ProductUpgradeCode. -->
    <ProductUpgradeCode>c38b9a96-d718-4419-b946-fda6009aec17</ProductUpgradeCode>
  </PropertyGroup>
  <!-- Under TFS Team Build, set CustomizableOutDir property to true in TFS 2005/2008/2010 UpgradeTemplate. -->
  <!-- With a workflow build, copy the default template then modify the MSBuild task for the solution build. Set OutDir to blank and -->
  <!-- CommandLineArguments to String.Format("/p:SkipInvalidConfigurations=true;TeamBuildOutDir=""{0}"" {1}", BinariesDirectory, MSBuildArguments). -->
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <DeploymentFrameworkTargetsPath>$(MSBuildExtensionsPath)\DeploymentFrameworkForBizTalk\5.0\</DeploymentFrameworkTargetsPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' == ''">bin\Debug\</OutputPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' != ''">$(TeamBuildOutDir)</OutputPath>
    <DeployPDBsToGac>false</DeployPDBsToGac>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <DeploymentFrameworkTargetsPath>$(MSBuildExtensionsPath)\DeploymentFrameworkForBizTalk\5.0\</DeploymentFrameworkTargetsPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' == ''">bin\Release\</OutputPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' != ''">$(TeamBuildOutDir)</OutputPath>
    <DeployPDBsToGac>false</DeployPDBsToGac>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Server'">
    <DeploymentFrameworkTargetsPath>Framework\</DeploymentFrameworkTargetsPath>
    <!-- Get our PDBs into the GAC so we get file/line number information in stack traces. -->
    <DeployPDBsToGac>true</DeployPDBsToGac>
  </PropertyGroup>
  <ItemGroup>
    <PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup" />
  </ItemGroup>
  <!-- !!! TODO !!! -->
  <!-- Add ItemGroup elements that contain one or more Schemas, Orchestrations, Transforms, etc. elements that describe -->
  <!-- the specific artifacts in your solution that need to be deployed. Use IntelliSense as a guide. -->
  <ItemGroup>
    <Schemas Include="CIC.GCMS.Common.CLR.Out.Schemas.dll">
      <LocationPath>..\$(ProjectName).Schemas\bin\$(Configuration)</LocationPath>
    </Schemas>
  </ItemGroup>
  <!-- !!! TODO !!! -->
  <Import Project="$(DeploymentFrameworkTargetsPath)BizTalkDeploymentFramework.targets" />
  <!--
    The Deployment Framework automatically packages most files into the server install MSI.
    However, if there are special folders that you need to include in the MSI, you can
    copy them to the folder $(RedistDir) in the CustomRedist target.
    To include individual files, add an ItemGroup with AdditionalFiles elements.
  -->
  <Target Name="CustomRedist">
  </Target>
</Project>
Coordinator
May 2, 2014 at 8:36 PM
Just set DeployPDBsToGac to false.

Thanks,
Tom
May 3, 2014 at 6:12 PM
Thanks, Tom.

It's funny how this interacts with SkipHostInstancesRestart though, since DeployPDBsToGac defaults to true it will stop the host instances but skipping the restarts will leave them down leading to an inconsistant state after the deploy/undeploy.

Another question related to this...

If DeployPDBsToGac is true then it seems to stop ALL host instances, unless I specifically list the host instances using item group for BizTalkHosts. However, for applications such as the one listed above that do not use any hosts (just deploys common schemas) there doesn't seem to be a way to avoid the deploy/undeploy stopping everything. Unless I list a "dummy" host, of course. Or did I miss something?
Coordinator
May 5, 2014 at 4:56 AM
In v5.5, there's an MSBuild target named BounceBizTalk that carries out the restart. If you already have DeployPDBsToGac set to false and you want to kill all restarts of the host instances, you can override and null out the BounceBizTalk target in your .btdfproj:
<Target Name="BounceBizTalk" DependsOnTargets="SetWinVer" />
Thanks,
Tom
May 5, 2014 at 3:26 PM
Thanks again