http://testsite
We expect it to render
http://testsite/Default.aspx
But instead we get 404 Not found error
. We did not had this issue when it was deployed on .Net 2.0. Only thing that has changed on the server is that we use .NET 4 instead of .NET 2.0.
UPDATE: I tried the following link but it did not work.
Getting an ASP.NET 4 application to work on IIS6
The framework version on the server is .NET 4 RC. Will it help if we install the latest .NET 4 version on the server?
Update: The issue is resolved now. The problem was a Third party upload control that we were using which added its own HttpHandler in Web.Config. This HttpHandler started failing in the .NET 4.
ASP.NET 3.5 and ASP.NET 4.5 are supported on IIS 8.0. ASP.NET 3.5 and ASP.NET 4.5 are supported on IIS 7.5. ASP.NET 3.5 and ASP.NET 4.5 are supported on IIS 7.0.
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 framework. 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.
Source Error:
Line 11: </configSections>
Line 12: <system.web>
Line 13: <compilation debug="true" targetFramework="4.0">
Line 14: </compilation>
Line 15: <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> </ system.web>
You have a few options;
To configure the IIS6 and web config to solve the issue. I deal with the second part:
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.
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:
<providerOption name="CompilerVersion" value="v3.5"/>
Hope this will solve your ASP.Net 4 migration and hosting issue at IIS6.
Here is a link to a more complete solution and explanation of this:
http://johan.driessen.se/archive/2010/04/13/getting-an-asp.net-4-application-to-work-on-iis6.aspx
Check the server logs, they will probably give you a better idea of what is going on.
You can find the path to the log file by right clicking the website in IIS and go to properties. Then goto the Web Site tab, under 'Enable logging' click properties and the logging properties window will show up which displays the path to the log file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With