Reputation: 804
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.
Upvotes: 3
Views: 1564
Reputation: 2956
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.
Upvotes: 4
Reputation: 12108
Useful information on this topic can be found in Scott Hanselman's blogpost Back to Basics: Using Fusion Log Viewer to Debug Obscure Loader Errors:
When it comes to assemblies there's three "times" to know about:
- Binding before it happens - What do you want?
ILDASM or Reflector will tell you what your assembly wants (what it was compiled against)- Binding as it happens - Where does it look?
Fusion (the Assembly Binding Log Viewer) will show you all assembly binds if you set the HKLM\Software\Microsoft\Fusion\ForceLog registry value to 1- Binding after it happens - What did you get?
Process Explorer will tell you what DLL (assembly) is loaded in memory and from where it came.
I believe Process Explorer should work also with Mono runtime and should show you which libraries are used by the running instance of MonoDevelop.
BTW I've seen unix transport errors when tested code called unmanaged library which caused segfault (memory corruption) so keep in mind that your problem might not be caused by the NUnit itself.
Upvotes: 0