[Mono-list] Can cross Windows and Linux platform mono application include Windows .NET C# dll ?

Maser, Dan Dan.Maser at inin.com
Thu Oct 1 10:07:28 EDT 2009


   Yeah, I do this with mono and it works very well for me.   Meaning that I have managed C# code that uses an unmanaged DLL via p/invoke.  I compile the C# code with .NET on Windows and mono on linux, and I compile the unmanaged (c++) code with vc++ on Windows and gcc on linux; using the same C# code and C++ code.   But of course I had to plan ahead to do this... primarily by not using Win32 APIs directly in code, I use portable libraries like ACE, BOOST, STLPort, ICU, and occasionally have a #ifdef section for platform specific code.


Dan Maser | Lead Software Developer
phone & fax +1.317.872.3000 | mobile +1.317.872.3000 | dan.maser at inin.com

Interactive Intelligence Inc.
Deliberately Innovative
www.inin.com


-----Original Message-----
From: mono-list-bounces at lists.ximian.com [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of chuchiehliu at micron.com
Sent: Thursday, October 01, 2009 9:06 AM
To: cdhowie at gmail.com
Cc: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Can cross Windows and Linux platform mono application include Windows .NET C# dll ?

Chris,

My understanding that the DLL will be an unmanaged one.  This is a great help for me.

Thanks,
Jerry

-----Original Message-----
From: Chris Howie [mailto:cdhowie at gmail.com] 
Sent: Wednesday, September 30, 2009 10:47 PM
To: chuchiehliu
Cc: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Can cross Windows and Linux platform mono application include Windows .NET C# dll ?

On Wed, Sep 30, 2009 at 6:19 PM,  <chuchiehliu at micron.com> wrote:
> I am looking for cross platform (Windows and RedHat Linux) application
> (WindowForm with dll) solution.
>
> (1)     Mono with X-develop is what I have tried first.  After I quickly
> created a Window.Form application using Windows mono 2.4 and X-develop, I
> can run it from RedHat Linux using “mono myapps.exe” command with mono
> version 1.9.1 that I got from website for my RedHat Linux.  It looks ok.
> After reading Mono-list, I am not sure whether my application which will
> need to include Windows dll (written in VC++ in dll and wrapped by .NET C#
> as dll) will work by using Mono together with X-develop environment?

If the DLL is unmanaged (it sounds like it is) then including a
Windows build of it will do no good.  You will have to compile this as
a native Linux library for Mono on Linux to be able to use it.

If the library uses non-portable calls (such as win32 functions) then
you will have to do the standard C/C++ thing and #if your way to
portability, or find a portable function that does the same thing.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Mono-list maillist  -  Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


More information about the Mono-list mailing list