Search code examples
c#.netmononunitmonodevelop

Equivalent of ldd for .NET/Mono Applications


I'm currently having some trouble with MonoDevelop and the Mono runtime. To be specific, when I run unit tests created with NUnit inside MonoDevelop, I get an "Unix transport error.". I read somewhere, that it is caused by a windows version of a DLL and I wanted to check on what libraries the NUnit library 'links against'.

So I was looking for an equivalent of ldd without having to write it myself...

I did not find anything like that, is there something?

Thanks in advance.


Solution

  • If you turn up MONO_LOG_LEVEL, you can watch Mono try to resolve assembly dependencies at run-time. This will walk through the global assembly cache and local directories, which might help give you a good idea of the specific .dlls that an application needs.

    Example (showing a .dll that can't be resolved):

    $ MONO_LOG_LEVEL=debug mono Clojure.Main.exe
    
    ...
    Mono: Assembly Loader probing location: '/usr/lib/mono/gac/Clojure/1.5.0.0__cf3caecd327a2fa9/Clojure.dll'.
    Mono: Assembly Loader probing location: '/usr/lib/Clojure.dll'.
    Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/Facades/Clojure.dll'.
    Mono: Assembly Loader probing location: '/usr/lib/mono/gac/Clojure/1.5.0.0__cf3caecd327a2fa9/Clojure.exe'.
    Mono: Assembly Loader probing location: '/usr/lib/Clojure.exe'.
    Mono: Assembly Loader probing location: '/usr/lib/mono/4.5/Facades/Clojure.exe'.
    Mono: The following assembly referenced from /home/bonh/foo/Clojure.1.5.0.2/tools/net40/Clojure.Main.exe could not be loaded:
     Assembly:   Clojure    (assemblyref_index=1)
     Version:    1.5.0.0
     Public Key: cf3caecd327a2fa9
    etc.