I want to compile a .NET 2.0 DLL by means CSharpCodeProvider from Microsoft .NET 4.0 Runtime. Is this possible?
By the way, Mono C# compiler can do it. using sdk
parameter (2 and 4 supported).
Something like this should work:
Dictionary<string, string> options = new Dictionary<string, string>();
options.Add("CompilerVersion", "v2.0");
CSharpCodeProvider provider = new CSharpCodeProvider(options);
See: CSharpCodeProvider Constructor (IDictionary).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With