views:

1243

answers:

1

I am interested in hearing about peoples experience with embedding mono (open source implementation of .NET) in a C/C++ application. How is it to distribute such an application and what are the dependencies? I have tested on OS X and mono comes as a huge framework (hundreds of MB). Do users of my app all need this big framework or can it be stripped down or everything be compiled into the main executable.

I previously have experience with embedding Lua in a C++ app, and that works really well because I can link statically the whole lua interpreter in with my main executable. So I have no external dependencies. Is it possible to do something similar with mono?

Any Lua people here who can comment on how they found mono compared to Lua?

PS: By embedding I mean a C++ application which initializes a mono environment and loads a .NET assembly and executes it and then allows for communication between say C# code in assembly and C++ methods in main executable.

+3  A: 

You should probably also take a look at Mono's Small Footprint page that describes how you can embed a smaller runtime. Heck, they do it themselves with Moonlight.

I hope that helps.

Dave Van den Eynde
Thanks. If I understand correctly, is mscorlib.dll and the JIT the only things that are required to get mono embedded? Is there a way to statically link mscorlib.dll?
Adam Smith
Mono allows you to completely statically link your code, so you probably don't even need the JIT. Have a look at their iPhone implementation.
Dave Van den Eynde