none
Object reference not set to an instance of an object.stack: at Microsoft.BizTalk.Operations.ItemEnumerator.LoadItems() RRS feed

  • Question

  • I am trying to automate few admin related work using operation dll. It is working well in my local when test with visual studio. 

    Now I deploy that console application in test as exe to schedule as a job. Their when that runs it gives following error even message exist . I can share my complete code if need but here are few line of it 

    Error I am getting  

    Error :Object reference not set to an instance of an object.stack:   at Microsoft.BizTalk.Operations.ItemEnumerator.LoadItems()
       at Microsoft.BizTalk.Operations.ItemEnumerator.MoveNext()
       at Zonses.LogSuspenededErrors.EDISuspendedMessage.GetMessageWithOperations()

    TrackingDatabase dta = new TrackingDatabase(DBServerName, DBName);
                    BizTalkOperations operations = new BizTalkOperations();
                    List<EDITransError> ediErrs = new List<EDITransError>();

                  
                    foreach (BizTalkMessage message in operations.GetMessages())
                    {
                        my guess is error is getting at operations.GetMessages() as that is line where it return as IEnumarable

    Thursday, March 2, 2017 11:50 PM

Answers

  • I think that dll itself got corrupt , as I try on different environment and no issue.
    • Marked as answer by dnyanbhar Friday, March 3, 2017 8:02 PM
    Friday, March 3, 2017 8:02 PM

All replies

  • I think that dll itself got corrupt , as I try on different environment and no issue.
    • Marked as answer by dnyanbhar Friday, March 3, 2017 8:02 PM
    Friday, March 3, 2017 8:02 PM
  • I think that dll itself got corrupt , as I try on different environment and no issue.

    Hi,

    I ran into a very similar Problem today. But I dont' think there is a corrupt DLL on my Server.

    If I run the exe from an elivated command line with my domain account, the 'GetMessages()' works.

    But it fails if started by Scheduled Task ('with highest privileges') but with a domain account, that is used to run the BizTalk host instance.

    This is my Code:

    BizTalkOperations operations = new BizTalkOperations(mgmtDbServer, mgmtDbName); List<BizTalkMessage> suspendedMsgs = operations.GetMessages() .OfType<BizTalkMessage>() .Where(x => x.MessageStatus == MessageStatus.Suspended)
    .ToList();

    That brings up a Null Reference Exception on operations.GetMessages() ... LoadItems()

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.BizTalk.Operations.ItemEnumerator.LoadItems()
       at Microsoft.BizTalk.Operations.ItemEnumerator.MoveNext()
       at HahnAir.ESB.HotFilesStatusMonitor.Program.RetrieveSuspendedMessages(String mgmtDbServer, String mgmtDbName, String hostName)

    What are your version numbers?

    BizTalk Server 2013 R2 (with CU5)
    Microsoft.BizTalk.Operations.dll   3.11.158.0
    Microsoft.BizTalk.Pipeline.dll        3.11.266.2

    Are there any special permission requirements for the account calling the GetMessages() ? (more than to run a host instance) I am sysadmin on the DB Server but the host account not ;-)

    Any hints?

    Tuesday, March 28, 2017 5:12 PM
  • I am using Biztalk 2010  now again I am getting the problem in production.

    If you could resolve it then let me know 


    • Edited by dnyanbhar Thursday, April 6, 2017 10:48 PM
    Thursday, April 6, 2017 10:47 PM
  • I am getting the similar issue as you mentioned. But in my case even if I run command line I still get the error.

    It runs in my test environment, a difference is my test environment is single machine environment. It means DB and Biztalk server on the same box. In production, it is not like that they are on different servers.

    Can somebody help me to resolve this?


    • Edited by dnyanbhar Friday, April 7, 2017 4:37 PM
    Friday, April 7, 2017 4:36 PM