Set the ASP.NET Version used by the Visual Studio ASP.NET Development Server


I'm trying to debug a problem which shows up under IIS7 using an application pool configured for .NET 4. My Visual Studio ASP.NET Development Server says it is using 2.0.50727.5456.

ASP.NET Development Server details dialog

I'd like to debug this out of VS so I'd like the .NET versions to match. I've found info on setting ports but there was no version setting nearby. And I couldn't find anything under the the Website.ASP Configuration menu item in VS either.

Is there any way to configure the ASP.NET Development Server's .NET version?

Best Solution

Check the targetFramework attribute of your compilation element in your web.config. If it's missing, add the attribute, and try setting it to 4.0.

If you're using a web application project (not a web site), try checking the project settings and look for Target Framework.