I'm kinda new here and this is my first question. So please don't rage at me when I'm doin something wrong (:
My problem: I'm trying to compile a C# source code in runtime, using CSharpCodeProvider.
It compiles without any problems unless i change the CompilerVersion to "v2.0" using this:
Dictionary<string, string> provOptions = new Dictionary<string, string>();
provOptions.Add("CompilerVersion", "v2.0");
CSharpCodeProvider provider = new CSharpCodeProvider(provOptions);
It shows errors in the 15th line which is this:
15: System.AppDomain.CurrentDomain.AssemblyResolve += (sender, args2) =>
16: {
17: byte[] assemblydata = Convert.FromBase64String(data);
18: return Assembly.Load(assemblydata);
19: };
For example:
Line 15, directly after "sender": ) expected
Line 15, directly after "sender": , invalid expression
And some more. I have no idea where the problem comes from. When I use the Visual Studio it compiles fine with "v2.0"