Code generation for property failed : Type ... is not marked as serializable
Posted on 2015-02-01
I'm designing a custom control. It has several properties and one of them is a List<ColumnItem>. ColumnItem is a class that i've made. This list is using an CollectionEditor. I change some stuff, compile and weird thing happen. So i try to debug it, i check at the form containing my custom control and i get this error: "Code generation for property 'ColumnItems' failed. Error was: 'Type 'System.Windows.Forms.UserControl' in Assembly 'System.Windows.Forms ... is not marked as serializable". If i remove my usercontrol from my test form, then put a new one, i get the same error. If i create a new form, voilà! It work.
Why am i getting this serialization havoc?
How can i avoid it?
Does it mean that once a custom control is added to my forms, i can't modify my control anymore? That wouldn't make much sense
Thanks for your help