Bug 44134 - XmlReader - MethodAccessException
Summary: XmlReader - MethodAccessException
Status: RESOLVED DUPLICATE of bug 41133
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-09-09 07:30 UTC by Anthony Rouneau
Modified: 2017-03-17 00:53 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

The part of code that throws the exception (19.99 KB, image/png)
2016-09-09 07:30 UTC, Anthony Rouneau

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Anthony Rouneau 2016-09-09 07:30:39 UTC
Created attachment 17390 [details]
The part of code that throws the exception


I have a very strange behaviour in my Xamarin.Droid app.

I use the code (cf. attachment) to parse a simple XML SOAP envelope and to create a XDocument. 

The problem is that `XDocument.Parse(xmlString)` raises the following MethodAccessException:

`Method 'System.Xml.XmlReader:get_DtdInfo ()' is inaccessible from method 'System.Xml.Linq.XContainer:ReadContentFrom (System.Xml.XmlReader,System.Xml.Linq.LoadOptions)'`

I believe this is an issue because the code is really simple, and the bug does not happen all the time.
Sometime the method works like a charm, and some other time, the method just fail repeatedly, until I relaunch the app.

I don't know if the problem is Xamarin.Droid related only.

It would be great to have some help about this!
Thanks in advance !
Comment 1 Marek Habersack 2016-09-09 16:23:00 UTC
The code you're referring to is not specific to Xamarin.Android, therefore I'm going to re-assign this bug to Mono BCL. Please, however, provide a small, self-contained application (it can be console app, XA app, Windows Forms app - the simpler the better) which triggers the issue. This will help the BCL team to investigate the issue.
Comment 2 Marek Safar 2016-09-12 13:18:55 UTC

*** This bug has been marked as a duplicate of bug 41133 ***
Comment 3 nikelyn 2017-01-12 08:58:40 UTC
Is there any information on this problem?
Comment 4 jamesh 2017-03-17 00:53:57 UTC
I was able to fix the problem by simplifying the doctype and xmlns tags in the SVG file.

More here: http://stackoverflow.com/a/42363385/1241612