Exception has been thrown by the target of an invocation. Object reference not set to an instance of an object....when I do test map


  • Hello

    I have a c# code in which I am calling a web service, and c# code returns a string value.

    I am calling that c# code from Biztalk Map script function as an external assembly

    but when I do test map I get the above above error...Can some one please answer...i m working on BTS2006R2 and i have also tried to test the c# code from a test windows applciation and where does return the values as expected..

    Tuesday, April 15, 2014 7:54 AM


All replies

  • Hi Sharmin,

    Please make sure the external assembly is GACed. This error usually occur when map is unable to access the external assembly.

    If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Tuesday, April 15, 2014 9:17 AM
  • Attach another instance of Visual Studio and it should break at that location.  Then you can see exactly what is null and go from there.
    Tuesday, April 15, 2014 12:36 PM
  • Hi,

    "Exception has been thrown by the target of an invocation" is a very generic exception. you need the inner exception to see the actual error. You can also try to test the map in the MapTester tool. It also shows also the inner exception. It's designed for BizTalk 2010 but with the .exe file you maybe also can test BizTalk 2006 maps,.


    Kind regards,

    Tomasso Groenendijk

    Blog  |  Twitter
    MCTS BizTalk Server 2006, 2010

    If this answers your question please mark it accordingly

    Tuesday, April 15, 2014 1:23 PM