none
MSBUILD Deploy Biztalk failed RRS feed

  • Question

  • Hello,

    I have created a deployment project.(btdfproj) for a biztalk solution that contains a schema project (MSC.Btz.Prism.Schemas) and a map project (MSC.Btz.Prism.Maps).

    The map project reference the schema project (MSC.Btz.Prism.Schemas) and an other schema (MSC.Btz.Common.Schemas) (from an other biztalk app (MSC.Btz.Common).

    MSC.Btz.Common is deployed and MSC.Btz.Common.Schemas is in the GAC

    My btdfproj looks like this :

    	<PropertyGroup>
    		<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
    		<Platform Condition="'$(Platform)' == ''">x86</Platform>
    		<SchemaVersion>1.0</SchemaVersion>
    		<ProjectName>MSC.Btz.Prism</ProjectName>
    		<ProjectVersion>1.0</ProjectVersion>
    		<IncludeSchemas>True</IncludeSchemas>
    		<IncludeOrchestrations>False</IncludeOrchestrations>
    		<IncludeTransforms>True</IncludeTransforms>
    ...
    	    <EnableBizTalkSchemaValidation>False</EnableBizTalkSchemaValidation>
    	</PropertyGroup>
    	<ItemGroup>
    		<AppsToReference Include="MSC.Btz.Common" />
    	</ItemGroup>
    	<ItemGroup>
    		<Schemas Include="MSC.Btz.Prism.Schemas.dll">
    			<LocationPath>..\MSC.Btz.Prism.Schemas\bin\$(Configuration)</LocationPath>
    		</Schemas>
    	</ItemGroup>
    	<ItemGroup>
    		<Transforms Include="MSC.Btz.Prism.Maps.dll">
    			<LocationPath>..\MSC.Btz.Prism.Maps\bin\$(Configuration)</LocationPath>
    		</Transforms>
    	</ItemGroup>

    When a run the command 

    %MSBUILD% /p:DeployBizTalkMgmtDB=true;Configuration=Server;SkipUndeploy=true /target:Deploy ...

    I have the following error :

    MSB4018 error: System.BadImageFormatException: Can not load file or assembly 'MSC.Btz.Prism.Maps, Version = 1.0.0.1, Culture = neutral, PublicKeyToken = 706ea9726d1ac67b' or one of its dependencies. attempt
    loading an incorrect format program. 

    Can somebody help me ?

    Thanks in advance

    • Edited by SandrAzure Friday, February 26, 2016 10:40 AM
    Friday, February 26, 2016 10:40 AM

Answers

  • Hi,

    Thank you for posting on MSDN forum.

    Seems you are using the 32-bit version of the tool, Look for the 32-bit version of the tool here:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

    The deployment script is executed by MSBuild.exe.  Many servers will have several versions of MSBuild.exe installed: one from .NET Framework 2.0, one from .NET Framework 3.5 and another from .NET Framework 4.0.  Any version should work.  The important thing is to run the 32-bit MSBuild.exe, even on Windows x64.

    "%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"


    Thanks,

    If my reply is helpful please mark as Answer or vote as Helpful.

    My blog | Twitter | LinkedIn

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:14 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:14 PM
    Saturday, February 27, 2016 1:14 AM
    Moderator

All replies

  • Well, I think i found the solution

    I have to use

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe instead of C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe

    Why can i detect which msbuild to use ?

    Thanks in advance

    Friday, February 26, 2016 10:44 AM
  • Hi,

    Thank you for posting on MSDN forum.

    Seems you are using the 32-bit version of the tool, Look for the 32-bit version of the tool here:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

    The deployment script is executed by MSBuild.exe.  Many servers will have several versions of MSBuild.exe installed: one from .NET Framework 2.0, one from .NET Framework 3.5 and another from .NET Framework 4.0.  Any version should work.  The important thing is to run the 32-bit MSBuild.exe, even on Windows x64.

    "%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"


    Thanks,

    If my reply is helpful please mark as Answer or vote as Helpful.

    My blog | Twitter | LinkedIn

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:14 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:14 PM
    Saturday, February 27, 2016 1:14 AM
    Moderator
  • Well, I think i found the solution

    I have to use

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe instead of C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe

    Why can i detect which msbuild to use ?

    Thanks in advance

    Hold on!

    Which command prompt are using to deploy the BizTalk Application?

    You should always use Developer Command Prompt.

    You have to run the 32-bit MSBuild.exe, even on Windows x64, so you have to always use 

    %windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

    Just follow the BTDF guide: Deploying an Application via Script


    Rachit Sikroria (Microsoft Azure MVP)

    Sunday, February 28, 2016 11:00 AM
    Moderator