Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Exception Handling in Orchestration
- This topic has 2 replies, 1 voice, and was last updated 9 years, 5 months ago by
community-content.
-
AuthorPosts
-
-
September 8, 2006 at 8:02 AM #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:
- How do I get my .NET assembly to log exceptions in an orchestration?
- If I set my Exception Block to System.Exception, will it handle BizTalk XLang, third party adapter, etc. exceptions as well?
Thanks, Bill N
-
September 9, 2006 at 11:46 PM #15631
For question no. 2, If the exception being thrown inherits System.Exception, Yes, the exception handler will catch it.
-
September 12, 2006 at 10:32 PM #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
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.