Running the ASP.NET 3.5 version on Server 2012 (or later)

by samantha copeland on December 6, 2015

As older servers are replaced, you may find yourself having difficulty getting the webforms edition to host properly with an ASP.NET 3.5/2.0 App Pool.  Not to worry, with a few minor changes to the web.config, you can use the application in a .NET 4.0 app pool.

First, go into your web server and create a new ASP.NET 4.0 App Pool.  Assign this new app pool to the website you are trying to run.  For best results, only share this app pool across other ASP.NET sites that were originally ASP.NET 3.5 applications.

You'll need to modify some of the web.config entries, first comment out the sections noted below:

<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>

Then update the key in <httpRuntime /> that should already have a maxRequestLength/executionTimeout, and add the 2.0 validation mode:

<httpRuntime maxRequestLength="10240" executionTimeout="90" requestValidationMode="2.0" />

At this point, you should be able to run the website.