Hi all,
I though I had solved this problem, but it is back:
Code generation for property 'SelectedPeople' failed. Error was: 'Type 'ECS.Entities.Persistency.Person' in Assembly 'ECS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.'
The property on the error message is a List(Of Person) and for some reason it trigger this error, for almost anything I do, and its getting really anoying.
Ok answering to the answers here is a little more information about the problem.
Yes it is during design time, it happens bascially anytime a open a form that has a UserControl that contains the Selected property in it, sometimes it happens even if I don't have focus on the form, also if I try to compile/run it happens and the message come in the form of a Message Box with just a OK, ECS.Entities.Persistency.Person is just a LINQ to SQL Generated Class, this should not matter at all to the problem, although I have added the attribute before the posting.
The reason that this happens is because the Designer attempts to put the property on the Property Panel, and for that to happen, serialization happens. To help on that I tryed to hide the property from the designer by using this attributes.
<DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
<Browsable(False)> _
Public Property SelectedPeople() As List(Of Person)
Get
Return _SelectedPeople
End Get
Set(ByVal value As List(Of Person))
_SelectedPeople = value
End Set
End Property
This was working before but for some unkown reason it started again.
If you all know anything about getting this fixed I would apreciate.
Thanks