[Mono-bugs] [Bug 401194] New: gmcs failed to load referencied assembly

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 18 05:47:02 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=401194


           Summary: gmcs failed to load referencied assembly
           Product: Mono: Compilers
           Version: SVN
          Platform: x86
        OS/Version: Kubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: migelU at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Hello.
I found compiler misbehavior during porting MS application to the MONO.
Here is my case:
Our application uses CSharpCodeProvider.CompileAssemblyFromFile to compile some
extension dll during runtime. 
To achieve this we build some source files and build list of assemblies that
must be referenced for proper building. These referenced DLL located in the
different places: our application location directory, GAC and temporary
directory (they are was unarchived from our internal storage).
for exmple (part of the gmcs command line):
/r:"/tmp/{4795b793-e276-45a1-9773-cfb3c216487c}/SimpleClass.Implementation.dll"
/r:"/home/user/Server/AppServer.Model.dll"
/r:"/usr/local/lib/mono/gac/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll"
/r:"/usr/local/lib/mono/gac/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll"
/r:"/usr/local/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll"
/r:"/home/user/Server/AppServer.ClientModel.dll"
/r:"/tmp/{4795b793-e276-45a1-9773-cfb3c216487c}/AppServer.Common.dll"

Same situation work well for MS csc compiler, but MONO gmcs compiler can not
load some assemblies from the temporary directory (in example
AppServer.Commmon.dll) since it try resolve all assemblies referenced by these
assemblies and can`not find it. 

Compiler output:
** (/usr/local/lib/mono/2.0/gmcs.exe:7902): WARNING **: The following assembly
referenced from
/tmp/{4795b793-e276-45a1-9773-cfb3c216487c}/AppServer.Common.dll could not be
loaded:
     Assembly:   Zml.Core    (assemblyref_index=2)
     Version:    1.0.5336.0
     Public Key: f01847ec0268e157
The assembly was not found in the Global Assembly Cache, a path listed in the
MONO_PATH environment variable, or in the location of the executing assembly
(/tmp/{4795b793-e276-45a1-9773-cfb3c216487c}).


** (/usr/local/lib/mono/2.0/gmcs.exe:7902): WARNING **: Could not load file or
assembly 'Zml.Core, Version=1.0.5336.0, Culture=neutral,
PublicKeyToken=f01847ec0268e157' or one of its dependencies.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'Zml.Core, Version=1.0.5336.0, Culture=neutral,
PublicKeyToken=f01847ec0268e157' or one of its dependencies.
File name: 'Zml.Core, Version=1.0.5336.0, Culture=neutral,
PublicKeyToken=f01847ec0268e157'
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetExportedTypes () [0x00000]
  at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly
assembly) [0x00000]
  at Mono.CSharp.GlobalRootNamespace.AddAssemblyReference
(System.Reflection.Assembly a) [0x00000]
  at Mono.CSharp.Driver.LoadAssembly (System.String assembly, System.String
alias, Boolean soft) [0x00000]
  at Mono.CSharp.Driver.LoadAssembly (System.String assembly, Boolean soft)
[0x00000]
  at Mono.CSharp.Driver.LoadReferences () [0x00000]
  at Mono.CSharp.Driver.Compile () [0x00000]
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list