Embedding MS.NET C# into c/c++ (like mono)

2019-08-10 20:02发布

问题:

Is it possible to embed the MS C# compiler into an umanaged c/c++ host application and make both languages interoperate, very much like Mono does this (like here and here)?
I have a working implementation of this für my Qt based C++ Application using mono, but I'm limited (I really need the memory) by the 32bit constraint of mono on Windows (there are no 64bit releases for windows). So can this be achived with "the original" C# implementation?

BTW: I'd like to continue using GNU compilers (mingw-w64).

回答1:

Microsoft does support this; their term for it is hosting.



回答2:

If you specifically want to use C# compiler, then Mono's C# compiler is managed, while Microsoft's C# compiler is native. There are some differences you cannot conquer.