[Mono-list] C# First port of application to mono

Danny dgortonii at gmail.com
Sun Feb 27 23:51:52 EST 2011


Actually, that *is* right, with some important notes.  Firstly, if your 
p/invoke calls are decorated with the full DLL name (MediaInfoLib.dll) 
then on Linux you must use Mono's dllmap to get it to find your native 
code due to the different naming conventions for shared object libraries.

For native libs that I control the source for and I can decide the 
compiled file names, I always make the 'root' of the names the same and 
p/invoke with just the file name, no extension.  Eg: MyCode.dll becomes 
libMyCode.so on Linux and the p/invoke DllIMport attributes use 'MyCode' 
as the dllName.  This can apply for 3rd party native libs too if their 
libraries are thusly named.  After that, the .NET and mono search 
algorithms work just fine on their respective platforms, as long as the 
native libs are in standard place (/lib, /usr/lib, local dir, system32) 
- see the docs for specific info on those search algorithms.  If not, 
again dllmap is your friend.




On 02/27/2011 05:59 PM, toxicious wrote:
> Hi guys,
>
> I am completely new to mono, only used it one time before to run a program
> on Ubuntu. I am a windows .NET developer but my interest for porting my apps
> to Linux has grown. I therefore ran MoMa and discovered that there is mainly
> one thing that needs to be fixed.
>
> I am calling a dll in my app (MediaInfoLib), this came up as a P/Invoke. I
> know MediaInfoLib is available for Ubuntu etc. but how do I use it? I mean
> is it just to replace the MediaInfoLib.dll in my to code to the name of the
> "dll-like" (.so?) for linux? That doesn't seem right. I am developing in
> VS2010.
>


More information about the Mono-list mailing list