Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Description of Problem:
Hi, I've create a simple application tha try to load data from xml file containing DataTable's structure and the relative data (at this moment the data are not present). The function crashes with an exception that says "minLength greater than maxLength". The xml file has been created through the corresponding DataSet.WriteXml(xml_file_name,XmlWriteMode.WriteSchema), and it contains the schema of 48 tables. Trying to isolate the issue, I've broken down the whole xml file into single table's xml files. I can load correctly only the first file; starting from the second I experience the same exception.
Steps to reproduce the problem:
private void PopulateHandler(object sender, EventArgs e)
string xmlFiles = Directory.GetFiles(dbPath, "*.xml");
int h = 0;
while (h < xmlFiles.Length)
DataSet ds = new DataSet();
catch (Exception xmlEx)
AlertDialog dlg1 = new AlertDialog.Builder(this).Create();
dlg1.SetMessage("Errore nel caricamento del file XML " + xmlFiles[h] + System.Environment.NewLine + xmlEx.Message);
An exception as I try to load the second file.
How often does this happen?
I've included only the relevant code snippet, the whole application doesn't do anything.
I've also attached the first five xml files.
I know it's not relevant, but the whole xml file is loaded correctly through the same methods under Windows.
Created attachment 11123 [details]
ZIp containing a sample of the files I'm trying to load
Sorry for the erroneous indication.
The first file actually doesn't contain the schema of a table, as the remaining 47, so the loading error occurs when the DataSet ecounters a table described in the file. The exception generated says that minLength is greater than maxLength, but minLength doesn't appear in the files. My impression is that Xamarin's System.Data.DataSet implementation is slightly different from Microsoft's System.Data.DataSet, so for the moment I'll try to find another solution.
Created attachment 11126 [details]
Zip containing two samples of the same data
odbc_AddWithKey is the file created with the corresponding option if the DataAdapter, odbc_NoAddWithKey is created without the option.
It turned out that the xml created with a DataSet populated with a DataAdapter with the option DataSet.MissingSchemaAction = MissingSchemaAction.AddWithKey; generates a structure that causes the error in Xamarin. I've attached two samples of the same set of data exported with and without this option.
I cannot reproduce the issue it works for me with 3.12,4.0,master