On 20.10.2015 06:37, donggas90 wrote:
Thanks, moljac.

That's reasonable.

Ultimately, my purpose is that edit C#, recompile it and invoke it in C++
runtume with the Mono API.
so I had found some article about it in this forum such as  this
<http://lists.ximian.com/pipermail/mono-devel-list/2010-July/035504.html>  .
but that article is too abstract to figure out how to do it exactly.
I have tried many ways to recompile and reload a assembly, but always
failed.
Finally, I'm really considering to give up to embed the Mono for my
application.

You have to realize first that embedding Mono won't give you
more `power' than the managed world would do.

I can understand the desire for code like this, although
it looks more like throwing the baby out with the bathwater
in a loop:

for (;;) {
        mono_jit_init ();
        do work
        mono_jit_cleanup ();
}

;)


If I had to attack this problem I'd do it this way:

(1) How do I achieve these tasks using manged code?

- compiling C#
- creating a domain
- loading an assembly
- executing code from this assembly
- unloading a domain

This is pretty basic stuff for .NET hackers and it's runtime-
agnostic (it runs on both Mono and MS.NET).

The next step:

(2) Factor out a managed assembly which performs (1) and
exposes a simple API which can be easily invoked from the
unmanaged world using Mono's embedding API.

Robert


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to