Home
About Me
Work History
Teaching
Curriculum
Education
Interests
Kenpo Karate
Guitar Page
Photo Gallery
Blog
Site
Web
Search
Login
|
Glenn's Blog
Glenn's Blog
My Ramblings
ASP.NET 4.0 and IIS 6.0 Target Framework Error
On November 24, 2011 in
ASP.NET
,
Programming
by
glenn stevenson
|
Comments
0
I teach an ASP.NET class and used an old server running Windows 2003 and II6 to allow the students to have their own web page. Everything was fine until we switched to the .NET Framework 4.0. At this point everyone received the following errors:
Temporary Solution
The temporary solution was to have the students remove the targetFramework directive from their web.config files:
This was definitely a temporary solution because it is difficult to ask beginning students to modify their web.config file without introducing a bunch of errors.
The solution
I searched all over the Internet and found several things that need to be done to get rid of this error. The first was to make sure the application pool for the site was using the .NET framework 4.0. To check this start IIS, right click on your web site, and select properties. Once the properties window opens you want to navigate to the ASP.NET tab. Here you want to make sure the correct version of ASP.NET is selected:
In my case this wasn't a problem, ASP.NET was setup correctly.
Compiler Version in web.config
The next thing to check is to make sure that the compiler version specified in the web.config file is correct. There is a section called compilers and it will specify which compiler the site is using:
Simply change this value to 4.0
Check Root Folder
In my case the web.config file did not define a compilers section. I was totally stumped until one day it dawned on me that I should take a look in the root folder of the site. Sure enough there was a web.config file that had the compiler version wrong. I changed the value from 3.5 to 4.0 and everything works like a charm.
Comments are closed.
Showing
0
Comment
Tagged with:
Compiler Version IIS 6
Categories
Programming (1)
ASP.NET (1)
Authors
glenn stevenson (1)
Archives
2011
November (1)
Tags
Compiler Version IIS 6
Copyright 2011 Glenn Stevenson
Terms Of Use
Privacy Statement