using Mono.CSharp; void Main() { var context = new CompilerContext(new CompilerSettings(), new ConsoleReportPrinter()); var clone = context.CloneContext(); }
using Mono.CSharp; void Main() { var context = new CompilerContext(new CompilerSettings(), new ConsoleReportPrinter()); var clone = context.CloneContext(); clone.Settings.AssemblyReferences.Add("MyAssembly.dll"); }In this example, we create a clone of a CompilerContext object and then modify one of its properties. Specifically, we add a new assembly reference to the clone's settings object. This change only affects the clone and does not modify the original context. The Mono.CSharp library is part of the Mono runtime, an open-source implementation of the .NET framework for Linux, macOS, and other platforms.