I compiled the test.cs
file (which references a third party library) using the dmcs
executable for Mac and the following command line program:
dmcs /out:program.exe test.cs /target:exe /reference:/Users/kevin/path/to/bin/Debug/project.dll
This compiled with no problems (excluding the /reference argument causes issues). This created a program.exe
executable in the current directory. When I tried to run it like this:
mono program.exe
I got the following error:
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'project, Version=3.4.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The only way I could figure out to solve this was by copying the project.dll
file into the directory containing the program.exe
file. Once I copied project.dll
into the same directory, the program ran correctly.
Is there an extra argument I can pass to mono
to specify DLL's in a different program directory? Or, is there a flag I can pass to dmcs
to get it to compile the DLL`s directly into the binary?