[Mono-list] System.Xml file not found?

Paolo Molaro lupus@ximian.com
Tue, 13 Aug 2002 15:31:32 +0200


On 08/13/02 J. Perkins wrote:
> I believe I've found a bug, but I'm not sure where I should log it.
> Using the following code:
> 
>     using System;
>     using System.Xml;
> 
>     class XmlTest {
>         static void Main() {
>             XmlDocument xml = new XmlDocument();
>             Console.WriteLine("xml created");
>         }
>     }
> 
> If I build it on Windows with csc, it will run under Linux/Mono.
> But if I build it on Linux with msc and try and run it under .net,
> I get:
> 
>  "Unhandled Exception: System.IO.FileNotFoundException: File or
>   assembly name System.Xml, or one of its dependencies, was not
>   found."
> 
> Is this a problem with the class library, the compiler, or the
> runtime?

For some reason the ms runtime can't load the System.Xml assembly.
There is already a bug filed on this: unlike with the mscorlib and
System assemblies, the ms assembly loader checks the version and
publictoken fields in a System.Xml assemblyref and since we set them to
0 (or null), the load fails.
You can avoid the problem by distributing the mono System.Xml
in the same dir as the application.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better