How to serialize the properties in user control?
I have tried the following code but I got InvalidOperationExceptio, While creating the XmlSerializer object
MyUserControl userControl = new MyUserControl();
XmlSerializer serializer = new XmlSerializer(typeof(MyUserControl));
Stream stream = new MemoryStream();
TextWriter writer = new StreamWriter(stream);
serializer.Serialize(writer, userControl);
Exception:
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=There was an error reflecting type 'Demo.MyUserControl'.