[Mono-dev] A bug in System.Xml blocking Entity Framework usage, #6653.

Atsushi Eno atsushieno at veritas-vos-liberabit.com
Thu Jan 31 04:38:54 UTC 2013


Thanks for the heads up. Yes there was. The problem with that bug report 
is that it does not bother to try to minimize the schema. It is actually 
so annoying task. Now I've trimmed down to 35 lines out from 1000.

<how to do it>

There are many extraneous schema components and type definitions that 
are irrelevant to the actual bug. Fortunately there is repro code that 
is useful to
see if your attempt to reduce extraneous components works or not.

Removing huge type definitions likely fails to keep "broken" schema. I'd 
start with cosmetic parts that however enable further type removal, 
which are:

- remove <attribute> and <attributeGroupRef> : they end up to free some 
<simpleType>s and <attributeGroup>s.
- remove particles in <sequence>, <choice>, <all> and <group> : 
similarly, but they could also free some <complexType>s too.

Then you can start trimming <simpleType>, <complexType>, <group> and 
<attributeGroup> elements, which will significantly reduce the lines of 
schema.

----

I'll have another look when I got another spare time (it took a while to 
do this reduction, so I stop it here so far), but now that the repro is 
smaller, anyone could also try to fix System.Xml.dll from mono source, 
namely mcs/class/System.XML/System.Xml.Schema. It is likely that some 
part of it need to resolve recursive reference nicely.
But it also seems very complicated that I can't say if it's fixable 
easily or anytime soon. Making changes in the schema itself or disabling 
schema validation somewhere should be much easier.

Atsushi Eno

Oleg wrote:
>
> Hello,
>
> There is a 5 months old bug #6653 
> <https://bugzilla.xamarin.com/show_bug.cgi?id=6653> and discussions on 
> StackOverflow about troubles with Entity Framework when it loads 
> metadata from xml model:
>
>   * How to setup Entity Framework / SQL Server with Mono
>     <http://stackoverflow.com/questions/13624065/how-to-setup-entity-framework-sql-server-with-mono>
>
>   * NullReferenceException with EF6 on Mono 3.0.3
>     <http://stackoverflow.com/questions/14582318/nullreferenceexception-with-ef6-on-mono-3-0-3>
>
>
> Could anyone say, is a date when it will be fixed predictable? It 
> would be very helpful to know it and plan own migration work.
>
> Now it looks like this defect blocks most of real life cases of Entity 
> Framework usage and this way blocks number of migration initiatives.
>
> P.S. What can I do to contribute to this issue resolution? Does it 
> makes sense to create separate bug about Entity Framework or attach 
> sample not working project to existing one?
> ------------------------------------------------------------------------
> View this message in context: A bug in System.Xml blocking Entity 
> Framework usage, #6653. 
> <http://mono.1490590.n4.nabble.com/A-bug-in-System-Xml-blocking-Entity-Framework-usage-6653-tp4658345.html>
> Sent from the Mono - Dev mailing list archive 
> <http://mono.1490590.n4.nabble.com/Mono-Dev-f1517221.html> at Nabble.com.
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list