Windows Develop Bookmark and Share   
 index > Windows Forms Designer > DataSet-type property is serialized in resx file.
 

DataSet-type property is serialized in resx file.

I designed a user control which has a property of DataSet type. When this control is used on a form, its DataSet property is serialized into the form's resx file. How can I prevent such a property from being serialized in a form's resx file. The problem is that when the version of the assembly which contains the user control is changed, and I try to build another assebmly with a form which contains this user control, I have the following exceptions error: Invalid Resx file. Could not load type MyDataSet, Version=1.0.0.1, Culture=neutral, PublicKeyToken=359090d86b1f7bd1 which is used in the .RESX file. Ensure that the necessary references have been added to your project.
Serge AG  Thursday, February 05, 2009 10:14 AM

Hi Serge,

I performed a test based on your description and did reproduce the problem on my side. This is the form designer that serialize the DataSet type property of the UserControl to the form's resx file. To change this default behavior, you need to implement a CodeDomSerializer on the UserControl to control the source code generation.

For more information on this, refer to the following MSDN document:
http://msdn.microsoft.com/en-us/library/system.componentmodel.design.serialization.codedomserializer.aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu

Linda Liu  Monday, February 09, 2009 9:41 AM

Hi Serge,

I performed a test based on your description and did reproduce the problem on my side. This is the form designer that serialize the DataSet type property of the UserControl to the form's resx file. To change this default behavior, you need to implement a CodeDomSerializer on the UserControl to control the source code generation.

For more information on this, refer to the following MSDN document:
http://msdn.microsoft.com/en-us/library/system.componentmodel.design.serialization.codedomserializer.aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu

Linda Liu  Monday, February 09, 2009 9:41 AM

You can use google to search for other answers

Custom Search

More Threads

• Previously visible user control becomes invisible in design view of winform(vb.net) in VS 2008.
• Why BackgroundImageLayout::center don't act like PictureBoxSizeMode::CenterImage
• Custom checkbox and radiobutton control
• ComboBox with DropDown style does not show initial value
• Auto change parent in design-time
• how to implement mousedrag event in c#
• CanConvertTo Not Called
• Bind Crystal report
• Label Color Error
• Remove events on collection editor...?