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: ,
Published Wednesday, January 27, 2010 11:33 AM by PSteele
Filed under:

Comments

# re: Using the CodeDom With .NET 3.5 Features

Funny.  I was just poking around the source to Spark View Engine yesterday and noticed this same thing.

github.com/.../BatchCompiler.cs

Good info to remember.

Wednesday, January 27, 2010 4:49 PM by Kevin Swiber

# Twitter Trackbacks for Using the CodeDom With .NET 3.5 Features - Patrick Steele's .NET Blog [asp.net] on Topsy.com

Pingback from  Twitter Trackbacks for                 Using the CodeDom With .NET 3.5 Features - Patrick Steele's .NET Blog         [asp.net]        on Topsy.com