Problem with system class not marked as serializable…

Home Page Forums BizTalk 2004 – BizTalk 2010 Problem with system class not marked as serializable…

Viewing 3 reply threads
  • Author
    Posts
    • #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?

       

    • #15990

      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

    • #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.

    • #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.

       

       

      • #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.

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