Search code examples
c#.netc#-4.0csharpcodeprovider

How do I run C# 4.0 compiler with CSharpCodeProvider class?


I'm using this snippet

CSharpCodeProvider codeProvider =
   new  CSharpCodeProvider(
      new Dictionary<String, String> { { "CompilerVersion", "v3.5" } });

for the 3.5 compiler for dynamic code compilation.

I'm assuming I should use "v4.0" to switch to the 4.0 compiler?


Solution

  • It is indeed v4.0