Exception Handling in Orchestration

Home Page Forums BizTalk 2004 – BizTalk 2010 Exception Handling in Orchestration

Viewing 2 reply threads
  • Author
    Posts
    • #15623

      I'm trying to create an exception handler to my orchestration. 
      I have created a scope shape and set its transaction type to long
      running.  I have added an exception block.  I have set the
      Exception Object Type to System.Exception.  I have also created a
      .NET assembly for my error logging.  I have referenced this in my
      project.  I have created a variable to this type (I identified the
      variable as Log).

      I'm having a problem with using the Log variable in the Exception block.  If I write Log.LogEvent("BlahBlah"); in an expression shape in the Exception Block I get "use of unassigned local variable 'Log'"
      error.  However, if I use the same expression shape in the scope
      variable before the Exception Block, there's no error and it logs
      "BlahBlah" perfectly.

      I have two questions then:

      1. How do I get my .NET assembly to log exceptions in an orchestration?
      2. If I set my Exception Block to System.Exception, will it handle BizTalk XLang, third party adapter, etc. exceptions as well?

       Thanks, Bill N

    • #15631

      For question no. 2, If the exception being thrown inherits System.Exception, Yes, the exception handler will catch it.

       

    • #15669

      Hi

      answer for 1st question

      For using .NET assembly in BizTalk project , you need to first add it in reference section , then you need to create a variable which is of type is class used in that assembly (This is creating object of class , normally we create in any language) , now use this varible in your expression shape to access methods of that class ……

      But the most important thing is before using .NET assembly , you need to add few line in AssemblyInfo file these are

      [assembly: ComVisible(false)]

      false)]

      [assembly: CLSCompliant(true)]

      [assembly: EnvironmentPermission(SecurityAction.RequestMinimum,Read="USERNAME")]

      and provide strong name key loaction in same AssemblyInfo file

      Also add [Serializable] tag just above the class declaration

       

       

      Sudershan

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