This code should cause the 4.0 ASP.NET development server to launch instead of the 2.0 ASP.NET development server. No matter which enumeration you use, it will always launch the 2.0 ASP.NET development server: settings.Web.LocalWebServer = LocalWebServerType.AspNetDevelopmentServer40; A sample test to repro the problem is attached.