Last post Nov 02, 2010 11:18 PM by rtpHarry
Apr 27, 2010 03:45 AM|ChrisDid|LINK
Hi. I've got a problem getting my .NET 4 Web Application to work in IIS 6. I'll retrace what I've done and hopefully someone might spot a gotcha. At least I hope to get an idea of where to look next.
I've upgraded my .NET 3.5 site to .NET 4.0 using Visual Studio 2010 conversion wizard. I've published the site as both a web site and a virtual directory on our Intranet with different results each time. For both configs I have made a separate Application
Pool and associated them with it.
As a WebSite:
I have the site files sitting in their own directory. I set the .NET version to 4.0 in Web Site propeties and use windows authentication only. I restart IIS. The site attempts to authenticate but fails after 3 attempts. I've checked the credentials I'm
entering and they are valid.
As A Virtual Directory:
I have the site files sitting in a subdirectory of the main web application. I set the .NET version to 4.0 in Web Site propeties and use windows authentication only. I restart IIS. When I go to the virtual directory address, I get a page not found error.
There are no errors in Event Viewer that I can see so from here I've no idea what to do to try and figure out why my site won't work.
iis 6 .NET 4.0 authentication
Apr 27, 2010 08:16 AM|Jalpesh P. Vadgama|LINK
I think you have not selected version for application pool. You need to select version of .net framework for application pool also.
Apr 28, 2010 11:21 PM|ChrisDid|LINK
There are no version selections for Application Pool in IIS6.
But I figured it anyway. I had to allow .net 4 in Web Extensions. So the Virtual Directory method is currently working.
Now I'm getting "value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later" message. I've put a location tag in the parent site web.config file and told it not to inherit, but I still get the error. I'm sure I'll figure
it in time though.
Thanks for posting.
Jun 18, 2010 03:05 AM|traitimvietnam|LINK
same problem .
Jun 18, 2010 08:12 PM|Pyrex|LINK
from web config worked for me.
Jun 19, 2010 01:19 AM|traitimvietnam|LINK
my server :
os windown server 2003
install .net 4.0
and here error when run script:
Line 10: <customErrors mode="Off" />Line 11: Line 12: <compilation debug="true" targetFramework="4.0" />Line 13: </system.web>Line 14:
Jul 08, 2010 08:37 AM|bibekweb|LINK
<p>With the new .NET 4 framework, comes some problems if you are running it on IIS 6 Windows Server. IIS 6 does not let you have more than one framework at the time running in the same instance like IIS7 that can create Application Pool targeting different
When IIS 6 runs under ASP.NET 2.0 (3.0 and 3.5 are superset, not frameworks) you are going to hit this error if the application is 4.0
Configuration Error Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
You have a few options;
1. Downgrade the .NET application to 3.5 that Visual Studio 2010 makes it really easy. Just go to the Website properties -> Application tab and there is a drop down with all the framework releases, select 3.5, you VS2010 will reload the project and modify
the web.config, if you added web service reference, that you may have to delete them and re-add them under 3.5
2. To configure the IIS6 and web config to solve the issue. I deal with the second part:
1. In IIS 6 console, you need to right click you project and click the property and check the ASP.Net tab whether Framework 4 is selected or not. If not select the framework 4. But still you might face the same error because of the application pool; you
might have same application pool for two different framework web application. IIS 6 does not let you have more than one framework at the time running in the same instance (means single application pool can’t use for two different frameworks) like IIS7 that
can create Application Pool targeting different framework.
2. To solve this issue you need to create application pool and assigned this application pool to you framework 4 web application. To assign the application pool, in IIS console open the properties section of the web application, and click on the “Home directory”
tab and selection application pool which you have created earlier from drop-down-list.
3. This two might now solve your problem completely sometime. You can get the error as “404 Page is not found”. Though you might now have any issue while in development time.
4. Basically page is not found issue is cause of other problem which is set hidden by is IIS6 . But you need to see the real cause. What you have do here is go to the IIS6 console open “web service extension node” which is right below the “default website”
node. You will see the entire ASP.Net framework list over there, by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button. Browse you website now, you get other error beside “404 Page is not found”. You might
get the error as listed below:
5. The value for the 'compilerVersion' attribute in the provider options must be 'v4.0'
You’ll see following error when browsing the website
The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the
'targetFramework' attribute from the element of the Web.config file.
To solve this issue, you need to modify your web config file as below:
<providerOption name="CompilerVersion" value="v3.5"/>
Previously the CompilerVersion value is set as v3.5 but we already change our targetFranework to 4. Thus according to the error message above the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version
4.0 or later of the .NET Framework. Hence your new setting will be as below:
Hope this will solve your ASP.Net 4 migration and hosting issue at IIS6.
NET 4.0 and IIS 6 Deployment problem
Oct 15, 2010 01:10 PM|funluckykitty|LINK
Thank you bibekweb. I had the same issue VS 2010, 4.0 framework, IIS6 on a vmMachine. IIS6 had 4.0 marked as "Prohibited" in the Web Service Extensions. Wonder why? Very odd......
Oct 21, 2010 12:36 PM|jambot|LINK
I've been scouring the web trying to workout the correct way to get .NET4.0 working on IIS 6. I've found a lot of useful suggestions but no complete solution. With a bit of luck though, I finally found how to do it properly. It doesn't involve commenting
out code (like the "targetframework" attribute in your web config file) and it doesn't involve any other shortcuts.
Just do this:
- install .net frame work 4.0 on your web server
- within IIS, go to "web service extensions" and ensure that .NET 4.0 has been added and allowed
- setup a new application pool for your .NET 4.0 websites/webapps. In IIS 6 only one framework can run within a given app pool, so just use this pool for .NET 4.0 stuff
- create your virtual directory as usual
- right click on it and select properties. From the "virtual directory" tab, ensure that you have selected the .NET 4.0 app pool you created above
- also from the "virtual directory" tab, click "configuration" and go to the "mappings" tab
- this is the key bit. Under application mapping, ensure that the executable path for each extension you want to use is mapped to the correct .NET 4.0 DLL. For instance, on my system I wanted to configure a WCF .svc file to run under .NET 4.0. So, I selected
.svc extension, clicked the "edit" button below and then browsed to the .NET 4.0 framework directry rather than the old .NET 2.0 one which was there already. I then chose the corresponding aspnet_isapi.dll file and clicked ok. Voila! It all works.
This is now up and running in corporate environment and seems to be fine.
I hope this helps somebody else out there.
Nov 02, 2010 11:18 PM|rtpHarry|LINK
Hey, just had to tackle this myself and because its quite a recent thread I thought i'd chip in.
Steps I had to take are as follows:
What that article told me in broad terms was:
The first article is aimed at showing you how to set the defaults for sites on your server from here on out so my steps above are a slight variation as I only wanted to set two specific sites to use asp.net 4 and the rest to continue defaulting to asp.net