2

I am running a C# executable which was built with a reference to a .Net library. The .NetLibrary is a wrapper around a C++ library, which resides in another folder (separate folder from the .NetLibrary).

The C++ library is in /usr/local bin The .Net library is in /projects/csharp/NetWrapperProj/bin/Debug The executable is in /projects/csharp/testharness/bin/Debug

As you may have guessed from the paths, I am running .Net using mono on Linux (Ubuntu 10.0.4). mono version 2.10.

How may I specify the required binaries to the executable - to avoid Unhandled Exception: System.IO.FileNotFoundException type exceptions being thrown?

1
  • Why do you have a library in /usr/local/bin? This is not a place the loader will look for it. Put it somewhere inside $LD_LIBRARY_PATH. Commented Aug 2, 2011 at 12:04

1 Answer 1

3

Normally, the DLLs/Libraries need to be in the same directory as the executable. From the Mono website:

If a library location has not been explicitly specified in a DllMap entry in an application or assembly .config file, Mono will search for a library in a few places:

  • The directory where the referencing image was loaded from.
  • In any place the system's dynamic loader is configured to look for shared libraries. For example on Linux this is specified in the $LD_LIBRARY_PATH environment variable and the /etc/ld.so.conf file. On windows the $PATH environment variable is used, instead.

You can read more at the Mono website on how to remedy this problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.