BizTalk2006.Application.AddReferences Object reference not set to an instance of an object.

Jun 16, 2010 at 10:05 AM



I'm trying to use the Microsoft.Sdc.Tasks.BizTalk2006.Application.AddReferences task to add a reference from one BT app to another. My msbuild code is:


<Target Name="BizApp">

   <!-- ... -->

      <BTRef Include="$(ReferencedAppName)"></BTRef>

    <BizTalk2006.Application.AddReferences Application="$(AppName)" Server="$(ServerName)" Database="$(BizMgmtDb)" ReferenceApplications="@(BTRef)" />
    <Message Text="Set References: @(BTRef)"></Message>



When I run it I get the following error message

C:\Program Files\CruiseControl.NET\server\myApp\build.msbuild (153,5):  error: A task error has occured.
Message               = Object reference not set to an instance of an object.
ReferenceApplications = Microsoft.Build.Framework.ITaskItem[]
Application           = myApp
Database              = BizTalkMgmtDb
Server                = localhost
   at Microsoft.Sdc.Tasks.BizTalk2004.BizTalk2004TaskBase.GetBtsCatalogExplorer(String server, String database)   
   at Microsoft.Sdc.Tasks.BizTalk2006.Application.AddReferences.InternalExecute()   
   at Microsoft.Sdc.Tasks.TaskBase.Execute()

Any ideas what I'm doing wrong?

Many thanks,



Jun 16, 2010 at 10:19 AM

I would guess that $(ReferncedAppName) is empty. Have you tried the MSBuild Extension Pack for BizTalk tasks? guidance is here

Jun 17, 2010 at 11:28 AM


I tried the MSBuild Extension pack as you suggested and that wokred perfectly.