Request a Quote

How to run .NET 2/3.5 website/webapplication into .NET 4 hosting environment

How to run .NET 2/3.5 website/webapplication into .NET 4 hosting environment

Issue:

It is general requirement that you want to host your ASP.NET 2.0/3.5 website/webapplication onto the hosting server which provide support for .NET Framework 4 but not for .NET Framework 2. At the time of development we normally assume that by default all application should run on .NET Framework 4 because backward compatibility is supported. But sometimes they are not because of new changes into ASP.NET 4.0. Here is the link for your reference: ASP.NET 4 Breaking Changes

Possible resolution:

For ASP.NET 2.0:
By adding below line in web.config inside should allow your application to run on .NET Framework 4.0

<compilation debug=”true” targetFramework=”4.0″ />

For ASP.NET 3.5:
Remove the below section from web.config and it should allow your application to run on .NET Framework 4.0

<configSections>

<sectionGroup name=”system.web.extensions” type=”System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″>

<sectionGroup name=”scripting” type=”System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″>
<section name=”scriptResourceHandler” type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication”/>

<sectionGroup name=”webServices” type=”System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″>
<section name=”jsonSerialization” type=”System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”Everywhere” />
<section name=”profileService” type=”System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” />
<section name=”authenticationService” type=”System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” />
<section name=”roleService” type=”System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” />

</sectionGroup>

</sectionGroup>

</sectionGroup>

</configSections>

I hope the resolution provided helps you to move forward.

Happy Programming…. :)

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2015 Trimantra Software Solution LLP- Software Outsourcing Company India. All rights reserved.