[Mono-devel-list] Better warning when an assembly can't be loaded

Joshua Tauberer tauberer at for.net
Tue Mar 22 09:46:06 EST 2005


Attached is a patch to slightly improve what happens when a referenced 
assembly at run time can't be found anywhere.

The warnings go from ('a' and 'b' are assemblies, 'A' is a class in 'a'):

** (b.exe:21606): WARNING **: Could not find assembly a, references from 
/mnt/part2/dev/b.exe (assemblyref_index=0)
      Major/Minor: 0,0
      Build:       0,0
      Token:
System error: No such file or directory

** (b.exe:21606): WARNING **: Could not load class from .A (token 
0x01000001) in /mnt/part2/dev/b.exe
mono: symbol lookup error: mono: undefined symbol: g_assert_warning

... to ...

** (b.exe:22598): WARNING **: The following assembly referenced from 
/mnt/part2/dev/b.exe could not be loaded:
      Assembly:   a    (assemblyref_index=0)
      Version:    0.0.0.0
      Public Key: (none)
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 (/mnt/part2/dev/).

** (b.exe:22598): WARNING **: The class A could not be loaded, used in 
/mnt/part2/dev/b.exe (token 0x01000001)


It would be nice to not have Mono die right after that, and instead 
throw a managed exception, but it looks like that involves a lot of work 
to carry the problem back to a point where an exception can be thrown.

Let me know if and when it's ok to commit.

-- 
- Joshua Tauberer

http://taubz.for.net

** Nothing Unreal Exists **


-------------- next part --------------
A non-text attachment was scrubbed...
Name: assemblynotfound.diff
Type: text/x-patch
Size: 4104 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050322/fb041a66/attachment.bin 


More information about the Mono-devel-list mailing list