Trying to target ASP.NET 2.0 in Visual Studio 2010

al-w-b
al-w-b used Ask the Experts™
on
My present application is in limbo....  It works great in IIS 5.5 targeted for .NET 4.0.  It does not work in IIS 7 targeted for .NET 4.0.

So to keep things safe I need to target it in ASP.NET 2.0, which should work.  It is an old stable application, but when I installed Visual Studio 2010 in configured the app for .NET 4.0.  I get numerous errors when I try to rollback to 2.0.

For starters... in Visual Studio 2010, under the website properties tab... the Target Framework drop down only lets me select ASP.NET 4.0... I can't change it to 2.0 here, so I guess I have to do it by hand.

My web config is below.  The errors I get in the 2.0 environment revolve around the ScriptManger.  However, I have the AJAX library in the bin and I am only using UpdatePanels and UpdateProgress panels in a very simple way.  It all used to work in the 2.0 environment before visual studio 2010 changed my web.config.

*note: In the code below I did not expose sensitive data.  IF you see something like [This works] it means that the value of that particular node has been tested and works in both IIS 7.0 and IIS 2.0.  

Based on this web.config file which direction would it be easier to take the app... ASP.NET 2.0 on IIS 6.0 or ASP.NET 4.0 on IIS 7.0?

What changes do I have to make to this web.config file to make it work in ASP.NET 2.0 again?

How can I add ASP.NET 2.0 to the Visual Studio 2010 Target Framework Drop Down list?


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<configSections>
		<sectionGroup name="system.web">
			<section name="urlrewrites" type="ThunderMain.URLRewriter.Rewriter, ThunderMain.URLRewriter, Version=1.0.783.30976, Culture=neutral, PublicKeyToken=7a95f6f4820c8dc3" />
		</sectionGroup>
		<sectionGroup name="EWS">
			<sectionGroup name="EWSControls">
				<section name="CurrencyCodes" type="System.Configuration.NameValueSectionHandler" />
				<section name="CountryCodes" type="System.Configuration.NameValueSectionHandler" />
			</sectionGroup>
		</sectionGroup>
		<section name="WebBusiness" type="WebBusiness.WebContent.ConfigurationSections.WebConfiguration" />
	</configSections>
	<connectionStrings>
		<clear />
		<!-- ABDC Local (LPTABDC)
		<add name="LocalSQLServer" connectionString="[This works]" providerName="System.Data.SqlClient"/>
		<add name="CNX" connectionString="[This works]" providerName="System.Data.SqlClient"/>-->
		<!-- HTPAC Production Live Database (www.howtoplayanysong.com)-->
		<add name="LocalSQLServer" connectionString="[This works]" providerName="System.Data.SqlClient" />
		<add name="CNX" connectionString="[This works]" providerName="System.Data.SqlClient" />
	</connectionStrings>
	<WebBusiness>
		<Redirects />
		<MetaData>
			<add Type="Title" Content="" />
			<add Type="Description" Content="" />
			<add Type="Keywords" Content="" />
			<add Type="Author" Content="" />
			<add Type="ResourceType" Content="document" />
			<add Type="Expires" Content="0" />
			<add Type="Copyright" Content="" />
			<add Type="Revisit" Content="1 days" />
			<add Type="Distribution" Content="Global" />
			<add Type="Rating" Content="General" />
		</MetaData>
		<PreloadImages />
		<Errors mode="Off">
			<IgnorList>
				<add Type="Timeout" Location="Any" />
			</IgnorList>
			<ErrorPages Default="~/Error.aspx">
				<add Type="Timeout" Location="~/Timeout.aspx" />
			</ErrorPages>
			<Notify>
				<add Type="Any" Location="Default.aspx" User="[Email Address works]" />
			</Notify>
		</Errors>
		<Google>
			<Analytics mode="On" trackingNumber="[Analytics ID Works]" />
			<AdWords mode="Off" />
			<Maps mode="On" key="[Maps Key works]" />
		</Google>
	</WebBusiness>
	<system.web>
		<webServices>
			<protocols>
				<add name="HttpPost" />
				<add name="HttpGet" />
			</protocols>
		</webServices>
		<httpRuntime maxRequestLength="104857600" executionTimeout="360000" />
		<sessionState mode="InProc" cookieless="false"></sessionState>
		
		<siteMap defaultProvider="XmlSiteMapProvider">
			<providers>
				<add name="XmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap" />
			</providers>
		</siteMap>
		
		<urlrewrites>
			<rule>
				<url>^(/.+(\.gif|\.css|\.zip|\.txt|\.msp|\.exe|\.aspx|\.ascx|\.asmx|\.csv|\.axd|\.master|\.png|\.jpg|\.ico|\.pdf|\.html|\.htm|\.swf|\.flv|\.xml|\.xsl|\.xsd|\.js|\%20)(\?.+)?)$</url>
				<rewrite>$1</rewrite>
				<processing>stop</processing>
			</rule>
			<rule>
				<url>/(.+)</url>
				<rewrite>/WebBusinessDataPage.aspx?PageTitle=$1</rewrite>
			</rule>
		</urlrewrites>
		<authentication mode="Forms">
			<forms loginUrl="Login.aspx" defaultUrl="Login.aspx" timeout="60" slidingExpiration="false" cookieless="UseCookies" />
		</authentication>
		<authorization>
			<allow users="*" />
		</authorization>
	
		<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" />
		<membership defaultProvider="WebMembershipProvider" userIsOnlineTimeWindow="30">
			<providers>
				<add requiresQuestionAndAnswer="true" connectionStringName="CNX" name="WebMembershipProvider" type="WebMembershipProvider" enablePasswordRetrieval="true" passwordFormat="Clear" enablePasswordReset="true" writeExceptionsToEventLog="false" />
			</providers>
		</membership>
		<roleManager cacheRolesInCookie="true" defaultProvider="WebBusinessRoleProvider" enabled="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
			<providers>
				<clear />
				<add name="WebBusinessRoleProvider" type="WebBusiness.WebMembers.WebBusinessRoleProvider" connectionStringName="CNX" applicationName="ABDC" writeExceptionsToEventLog="false" />
			</providers>
		</roleManager>
		<pages masterPageFile="~/Templates/Default.master" theme="Default" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
			<controls>
 [The Controls are ok, they work in ASP.NET 2.0]
			</controls>
		</pages>
		<!--
          Set compilation debug="true" to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    -->
		<compilation debug="true" defaultLanguage="c#" targetFramework="4.0">
			<assemblies>
				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></assemblies>
		</compilation>
		<httpHandlers>
			<add verb="*" path=".*" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
		</httpHandlers>
		<httpModules>
			<add name="SessionEndModule" type="WebBusiness.Modules.SessionEndModule" />
			<!--<add name="IIS5XWildCardExtensionFix" type="IIS5XWildCardExtensionFix"/>-->
			<add name="RedirectModule" type="WebBusiness.WebContent.Modules.RedirectModule" />
			<add name="MetaDataModule" type="WebBusiness.WebContent.Modules.MetaDataModule" />
			<!--<add name="PreloadImageModule" type="WebBusiness.WebContent.Modules.PreloadImageModule"/>-->
			<add name="ScriptManagerModule" type="WebBusiness.WebContent.Modules.ScriptManagerModule" />
			<add name="GoogleScriptModule" type="WebBusiness.WebContent.Modules.GoogleScriptModule" />
		</httpModules>
	</system.web>
	<location path="Documents">
		<system.web>
			<authorization>
				<deny users="?" />
			</authorization>
		</system.web>
	</location>
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false" />
        <defaultDocument>
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="ComingSoon.htm" />
            </files>
        </defaultDocument>
	</system.webServer>
	<system.net>
		<mailSettings>
			[Mail Settings Work]
		</mailSettings>
	</system.net>
	<system.serviceModel>
		<bindings />
		<client />
	</system.serviceModel>
</configuration>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you are using AJAX Toolkit Version 3.5, then you cannot use framework 2.0
The minimum requirement for this is .net 3.5 SP1.

What is the error you are getting in .net 4.0 with IIS7

Author

Commented:
l

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial