Results 1 to 2 of 2

Thread: [RESOLVED] [2005] Error using BinaryFormatter

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Resolved [RESOLVED] [2005] Error using BinaryFormatter

    I am trying to serialize a class to a file using the BinaryFormatter. I keep getting this error:

    "Type 'System.Windows.Forms.UserControl' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable."

    and I don't know why. The class makes no reference to any user control, or form. This class is a property of a user control, but I don't see why that would be an issue. The class is in its own project with no reference to System.Windows.Forms.

    Does anyone have any idea why I would be getting this error?


    I just found what is causing the errors. It's because of 2 custom events. How can I serialize the object and keep the events?
    Last edited by mpdeglau; Oct 2nd, 2006 at 01:50 PM.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width