I am looking to replace certain reflection-based parts of our code with ones that perform better using dynamic runtime compilation. Looking around I saw that both Mono and Microsoft have separate Compiler-as-a-Service solutions: Mono.CSharp
and Microsoft.CSharp
.
With the risk of asking an opinion-based question, I'm wondering how these two compare?
As far as I can tell from a very superficial initial investigation, they both generally provide CAAS capabilities. I was able to compile a "Hello World" class using Microsoft.CSharp and execute it. And although I didn't do the same thing with the Mono one yet, I'm assuming it could do the same.
Does anyone have any experience with either or both and can comment on the issue?
Edit: I am not asking about a comparison of Mono's C# and Microsoft's C# - we are already familiar with and using both. The question is specifically about the two CAAS (Compiler-as-a-Service) solutions.
CAAS isn't (yet anyway) a standard part of the .NET runtime, i.e there is no System.Compile
namespace yet. The two solutions Mono.CSharp
and Microsoft.CSharp
are separate non-standard CAAS solutions for C#. Their interfaces are very different and hence the question.