Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Problem with system class not marked as serializable…
- This topic has 5 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
October 9, 2006 at 9:25 AM #15987
Exception thrown from: segment 1, progress 27
Inner exception: Type 'System.Diagnostics.EventLog' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
Exception type: SerializationException
Source: mscorlib
Target Site: System.Reflection.MemberInfo[] InternalGetSerializableMembers(System.RuntimeType)
Is there anything that can be done to resolve this issue?
-
October 9, 2006 at 12:07 PM #15990
-
October 11, 2006 at 12:50 AM #16013
[quote user="Stephen W. Thomas"]
You could make this call inside an Atomic Scope shape or from with in a static method.
Are you using Enterprise Library with a Category? If so, see this: http://www.biztalkgurus.com/blogs/biztalk/archive/2006/07/10/Working-with-Enterprise-Library-Logging-Categories-in-BizTalk.aspx
[/quote]
Thanks a lot Stephen!
I'm working now with a solution that uses an Atomic Scope to access the system.dignostic.evenlog … classes and it seams to work!
-
-
December 4, 2006 at 9:17 AM #16694
you expression shape which contains the calling code needs to be housed in an atomic scope shape. atomic scopes does not have persistence points, so non-serizable code can be called from this.
-
December 4, 2006 at 10:45 AM #16697
If you are using 'System.Diagnostics.EventLog in a classlib as a class member, I would have to disagree with the others, provided you have control over the class lib. In general there is no reason to make the event log object a class member, instantiate within the function where you want to use it. The object does not have any state and little overhead, so it does not need to be a class member.
If you cannot edit the class then you must atomitize it.
-
December 4, 2006 at 1:41 PM #16703
I use .EventLog.WriteEntry() all the time without an Atomic Scope Shape.
I think it’s static.
Maybe there is another way to accomplish what you are trying to do using Static methods.
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.