If I make a change in design-mode to a form that has a DropDownList or an UltracomboEditor, I'm seeing a strange error. I'm trying to add a button -- the change I'm making to the form shouldn't affect the dropdown at all, but it does. It looks like when the .resx file is getting recreated, it somehow adds the wrong value. After the change, the form won't compile, and VS won't even let me reopen the form. Full text of the error is below. In the .Resx File:
<data name="ValueListItem24.DataValue" mimetype="application/x-microsoft.net.object.binary.base64"> <value> AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAARE YXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEICgIAAAAGAgAAAAAL </value> </data>
becomes
<data name="ValueListItem24.DataValue" mimetype="application/x-microsoft.net.object.binary.base64">
<value> AAEAAAD/////AQAAAAAAAAAEAQAAAA1TeXN0ZW0uREJOdWxsAwAAAAREYXRhCVVuaXR5VHlwZQxBc3Nl bWJseU5hbWUBAAEICgIAAAAGAgAAAAAL</value>
Error 138 TargetInvocationException: Type in the data at line 1046, position 5, cannot be loaded because it threw the following exception during construction: Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.
at System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader)
at System.Resources.ResXResourceReader.EnsureResData()
at System.Resources.ResXResourceReader.GetEnumerator()
at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources(ReaderInfo readerInfo, IResourceReader reader, String fileName)
at Microsoft.Build.Tasks.ProcessResourceFiles.ReadResources(String filename, Boolean shouldUseSourcePath)
at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFileOrDir)
XmlException: Type in the data at line 1046, position 5, cannot be loaded because it threw the following exception during construction: Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed. Line 1046, position 5.
NotSupportedException: Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.
at System.DBNull..ctor(SerializationInfo info, StreamingContext context)
Thanks,
Brad Larsen
Stratis Business Systems, Inc.
Hello Brad Larsen,
Our engineering staff has examined this issue and reported that that it is a Microsoft Visual Studio issue. It has been reported by several people within the past year. http://connect.microsoft.com/VisualStudio/feedback/details/729281/wrong-deserialization-winforms
To work around this issue, is it possible for you to not use DBNull as the first value and instead use add the item at run-time and setting it to null? Please let me know if you have any additional questions.
Hello Brad,
I have logged a development issue for this.
You can view the status of the development issue connected to this case by selecting the "Development Issues" tab when viewing your active cases on the web site.
Thank you for your sample. I was not able to build, run your sample as intended. However I was also not able to reproduce the issue. What version and build of Netadvantage are you using?
Steps I made to try and reproduce the issue:
1. Created a project, opened the designer for the form
2. Added an UltraComboEditor, opened its Edit Items wizard menu to add value list items.
3. Set the first value item to DBNUll
4. Added a button and dropdownlist, saved the project and closed the project
I am still investigating this issue. Please let me know if you have any additional questions.
Yes, I've attached a very simple example. It just has a single UltraComboEditor. I just added it to a blank form, added a few values, and set the first value to DBNull.
Thank you for contacting Infragistics. I have been assigned to handle your case. I would like to understand more about the requirements of your application. Can you provide me with sample that throws the Null error message.
Please let me know if you have any additional questions.