Using the CodeDom With .NET 3.5 Features

Here it is 2010 and I just noticed while trying to use the CodeDom features of .NET that it defaults to using the .NET 2.0 compiler.  You have to specifically tell it to use .NET 3.5.  Thanks to LukeH and a Stack Overflow question, it was an easy solution:

var providerOptions = new Dictionary<string, string> {{"CompilerVersion", "v3.5"}};
CodeDomProvider provider = new VBCodeProvider(providerOptions);

Yeah, I had to do some integration with some VB.NET codeā€¦

Technorati Tags: ,

No Comments