[Mono-osx] Can't find dll:(

david1969 at itu.dk david1969 at itu.dk
Tue Oct 10 08:33:12 EDT 2006


I'm just attempting my first foray into the world of mono/c# on OS X.

I have tried to compile the source of a network library into a dll with
the following (which seems to work fine):

mcs *.cs -out:lidgren.dll -target:library

When I then attempt to access the dll with the following:

using System.Runtime.InteropServices;
using System;

public class Test {
  public static extern bool IsNullOrEmpty(string x);

  static void Main() {
    bool result=IsNullOrEmpty("");

by typing the following at the terminal:

mono Test.exe

I get the following:
Unhandled exception: System.DllNotFoundException: lidgren.dll
in (wrapper managed-to-native) Test:IsNullOrEmpty (string)
in <0x0001c> Test:Main ()

Any ideas? Is the dll not compiled correctly? It's in the same directory
as the .exe...

More information about the Mono-osx mailing list