BTDF Build/Deploy: EXEC : error : Failed to add resource(s).

Topics: Server Deployment
Jul 31, 2013 at 9:00 PM
Trying to run BTDF build/deploy:

DeploySchemas:
BTSTask.exe AddResource -Type:BizTalkAssembly -Source:"..\SCHEMAS\bin\Debug\Aoc.Dx.Get.Services.SCHEMAS.dll" -ApplicationName:"Aoc.Dx.Get.Services" -Options:GacOnAdd,GacOnImport,GacOnInstall
Microsoft (R) BizTalk Application Deployment Utility Version 3.9.469.0
Copyright (c) 2010 Microsoft Corporation. All rights reserved.

Information: Adding resource (-Type="System.BizTalk:BizTalkAssembly" -Luid="Aoc.Dx.Get.Services.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=acb921476099768e") to application "Aoc.Dx.Get.Services"...
Serialized BizTalk assembly "Aoc.Dx.Get.Services.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=acb921476099768e" from "..\SCHEMAS\bin\Debug\Aoc.Dx.Get.Services.SCHEMAS.dll".
Information: Validating resources (count=1)...
  • Validating resource (-Type="System.BizTalk:BizTalkAssembly" -Luid="Aoc.Dx.Get.Services.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=acb921476099768e")...
    Information: Performing change requests...
    Information: Calling BeginTypeChangeRequest for all selected resource types...
    PerformingBeginChangeRequest
    Adding resource (-Type="System.BizTalk:BizTalkAssembly" -Luid="Aoc.Dx.Get.Services.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=acb921476099768e") to store.
    Information: PerformingEndChangeRequestsWithRollBack
  • Performing EndTypeChangeRequest for resource type "System.BizTalk:BizTalkAssembly".
    EXEC : error : Failed to add resource(s). [C:\P4_Workspaces\ESBDataExchange\Person\Aoc.Dx.Get.Services\Deployment\Deployment.btdfproj]
    Resource (-Type="System.BizTalk:BizTalkAssembly" -Luid="Aoc.Dx.Get.Services.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=acb921476099768e") already in store.
    1) Use BTSTask's overwrite flag or
    2) Set redeploy flag to true in BizTalk Project or
    3) Click overwrite all checkbox in Admin MMC
    to update if the resource exists in the specified target application "Aoc.Dx.Get.Services".
    Overwrite flag will be ignored if the resource is associated with another application.
Command failed with 1 errors, 0 warnings.

There is no such dll in the GAC ("already in the store")
Coordinator
Jul 31, 2013 at 10:30 PM
Perhaps you have previously deployed this application using the out-of-the-box deployment tooling. Do you have this application or any artifacts from it deployed inside the BizTalkServerApplication?
Jul 31, 2013 at 10:34 PM

No…I checked your previous responses where you diagnosed specification of the same DLL in different item groups in Deployment.btdproj. Nothing like that here:

Here is Deployment.btdproj:

<?xml version="1.0" encoding="utf-8"?>

<!--

Deployment Framework for BizTalk 5.0

Copyright (C) 2004-2012 Thomas F. Abraham and Scott Colestock

-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Installer" ToolsVersion="4.0">

<PropertyGroup>

<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>

<Platform Condition="'$(Platform)' == ''">x86</Platform>

<SchemaVersion>1.0</SchemaVersion>

<ProjectName>Aoc.Dx.Get.Services</ProjectName>

<ProjectVersion>1.0</ProjectVersion>

<IncludeOrchestrations>True</IncludeOrchestrations>

<IncludeTransforms>True</IncludeTransforms>

<IncludeDeploymentTest>True</IncludeDeploymentTest>

<SkipIISReset>True</SkipIISReset>

<IncludeSSO>False</IncludeSSO>

<UsingMasterBindings>True</UsingMasterBindings>

<RequireXmlPreprocessDirectives>False</RequireXmlPreprocessDirectives>

</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>1.0.4</ProductVersion>

<ProductId>c4734394-ff5d-41c1-96cf-aa46ee8d9f68</ProductId>

<!-- BizTalk App Version Upgrade -->

<ProductName>Aoc.Dx.Get.Services for BizTalk</ProductName>

<Manufacturer>AOC</Manufacturer>

<PackageDescription>Aoc.Dx.Get.Services</PackageDescription>

<PackageComments>Aoc.Dx.Get.Services</PackageComments>

<!-- NEVER change the ProductUpgradeCode. -->

<ProductUpgradeCode>92cf86fc-5717-4574-82dc-b16e44a15d84</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-->

<ItemGroup Condition="'$(Configuration)' == 'Debug'">

<!-- We name our host(s) explicitly to avoid having the framework bounce them all. -->

<BizTalkHosts Include="BizTalkServerApplication" />

</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">

<!-- We name our host(s) explicitly to avoid having the framework bounce them all. -->

<BizTalkHosts Include="BizTalkServerApplication" />

</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Server'">

<!-- We name our host(s) explicitly to avoid having the framework bounce them all. -->

<BizTalkHosts Include="BizTalkServerApplication" />

</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="Aoc.Dx.Get.Services.SCHEMAS.dll">

<LocationPath>..\SCHEMAS\bin\$(Configuration)</LocationPath>

</Schemas>

</ItemGroup>

<ItemGroup>

<Transforms Include="Aoc.Dx.Get.Services.MAPS.dll">

<LocationPath>..\MAPS\bin\$(Configuration)</LocationPath>

</Transforms>

</ItemGroup>

<ItemGroup>

<Orchestrations Include="Aoc.Dx.Get.Services.ORCHESTRATIONS.dll">

<LocationPath>..\ORCHESTRATIONS\bin\$(Configuration)</LocationPath>

</Orchestrations>

</ItemGroup>

<ItemGroup>

<DeploymentTest Include="DeploymentVerification.Tests.dll">

<LocationPath>..\DeploymentVerification.Tests\bin\$(Configuration)</LocationPath>

</DeploymentTest>

</ItemGroup>

<!-- The app.config file is set in VS to "Copy always" to the output directory, and here it is included in the MSI. Below it gets preprocessed to merge-in the environment-specific settings for the deployment verification tests. -->

<ItemGroup>

<AdditionalFiles Include="app.config">

<LocationPath>..\DeploymentVerification.Tests\bin\$(Configuration)</LocationPath>

</AdditionalFiles>

</ItemGroup>

<ItemGroup>

<FilesToXmlPreprocess Include="app.config">

<LocationPath>..\DeploymentVerification.Tests\bin\$(Configuration)</LocationPath>

<OutputFilename>DeploymentVerification.Tests.dll.config</OutputFilename>

</FilesToXmlPreprocess>

</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>

<Target Name="CustomFinalDeploy" Condition="'$(Configuration)' == 'Server'" >

<Delete Files="$(PortBindings)" TreatErrorsAsWarnings="false" />

</Target>

</Project>

Coordinator
Aug 1, 2013 at 5:48 PM
I would undeploy the application with the Deployment Framework, then go to BizTalk Admin, Group/Applications/<All Artifacts>/Resources, sort by the Name column, and be certain that none of your app assemblies are listed there. I still suspect that you already have parts of the app deployed into BizTalk.

Thanks,
Tom
Aug 2, 2013 at 11:43 PM
Thanks, ffor your response follow on...do I need to remove previously-generated PortBindings.xml from my solution before deploying via BTDF? This would have nothing to do with stale PB.xml screwing up the build? ________________________________________
Coordinator
Aug 3, 2013 at 5:23 AM
Port bindings have nothing to do with assembly deployment, so that is not related to this issue. Every time you run a Deployment Framework Deploy the PortBindings.xml is re-generated, so there is no need to keep it around (assuming that you have a PortBindingsMaster.xml).

Thanks,
Tom
Aug 5, 2013 at 4:24 PM

Thanks for all your help…turns out because I didn’t provide application names to my projects, the .dlls were deployed to the default application… I was confused because I didn’t see the existing .dlls in the GAC_MSIL (?).

Thank you for your indulgence…

M