MSBuild script for BizTalk AddReference

Home Page Forums BizTalk 2004 – BizTalk 2010 MSBuild script for BizTalk AddReference

Viewing 1 reply thread
  • Author
    Posts
    • #19118

      How can i write a build script for a BizTalk application referring to another BizTalk application?

      I have a application, BizB referring BizA.On a hard search i created some sample script followed but throwing an error at ReferenceApplications=”BizA”
      Is some thing i am missing of? Is ‘ReferenceApplications’ is an array type?

      <Target Name=”AddReferences” >
        <BizTalk2006.Application.AddReferences
         Application=”BizB”
         ReferenceApplications=”BizA”
         Server=”<Servername>”
         Database=”<DBName>”
         Password=””
         UserName=”” />
        <Message text=”Application Reference Added:” />
       </Target>

    • #19143

      Give us some more details. What kind of error have you got?
      Did you install Sdc Tasks and import them into your MSBuild project?

      By the way, that’s how I use it (BizB refers to BizA and BizC):

        <PropertyGroup>
          <BTApplicationName>BizB</BTApplicationName>
        </PropertyGroup>

        <ItemGroup>
          <BTRef Include=”BizA”></BTRef>
          <BTRef Include=”BizC”></BTRef>
        </ItemGroup>

        <Target Name=”ApplicationReferences”>
          <BizTalk2006.Application.AddReferences
                  Application=”$(BTApplicationName)”
                  Server=”$(BTServerName)”
                  Database=”$(BTServerDatabase)”
                  Password=””
                  Username=””
                  ReferenceApplications=”@(BTRef)” />
          <Message Text=”Set References: @(BTRef)”>
          </Message>
        </Target>
       

      Regards,
      Nick

      • #19144

        Hi Nick,

        I tried with same code snippet you supplied but unfortunately got the following error:

        Target AddAppReferences:
             : error : A task error has occured.
             : error : Message               = Application  does not exist
             : error : ReferenceApplications = Microsoft.Build.Framework.ITaskItem[]
             : error : Application           = BizB
             : error : Database              = BizTalkMgmtDb
             : error : Password              = <null>
             : error : Server                = <ServerName>
             : error : Username              = <null>
             : error :
             : error :    at Microsoft.Sdc.Tasks.BizTalk2006.Application.AddReferences.InternalExecute()
             : error :    at Microsoft.Sdc.Tasks.TaskBase.Execute() 

        I double checked that all applications are deployed and i can view them in Management Studio as well as from BizTalk admin console.

        And also Sdc Tasks was imported.Is i am missing any thing?

        Thanks in Advance,

        Arun

        • #19161

          Hi Arun,

          I’ve just checked source code of the AddReference class.

          It gives you such kind of error only if either your parent or one of the referenced applications does not exist in the BTS catalog.

          If you deploy the applications in the same MSBuild script, check the order you run targets. You can also try to use Application.Exists task to check existance of your apps just before you run AddReference.

          Regards,

          Nick 

          • #19169

            Hi Nick,

            Thanks for your reply.

            I checked AppExists before AddReferences task and found that the AppExists returned ‘True’ means applications are exist.But the rest is the same story saying ‘application is missing’ in AddReferences task.

            I am deploying BizA first and then followed BizB.

            Thanks in advance,

            Arun

             

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.