Fixing an ASP.NET 2.0 App after upgrading to 3.5

by JoeStagner 3/25/2008 5:22:06 AM

When you first open an ASP.NET 2.0 website in Visual Web Developer / Visual Studio 2008, VS asks you if you want to upgrade the project to 3.5.

35Up-2

As some of you who are using Microsoft AJAX and who say YES to upgrade to 3.5 have noticed, when you go to run your newly upgraded application (which worked fine before the upgrade), you get build errors !!!

35Up-3

The build error complains that it can't load System.Web.Extensions Version 1.0.61025.0

35UpError

That's the OLD version of Web.Extensions (AJAX)  that works with ASP.NET 2.0.

You'll note a number of references in your web.config file to this old version. Since before the 2008 release wave, MS AJAX was loaded via separate assemblies and since it is now "baked in" to ASP.NET, it's hard for the upgrade tool to know that you don't need the referenced version.

UpVer1

So..... In your web.config change all the 1.0.61025.0 version references to 3.5.0.0 (unless you are using some CTP or Futures Version)

 

UpVer35

If you are using the AJAX Control Toolkit there is still a bit of work to do.

You will now get this error on your Toolkit Control instances.

35Up-8

Download the version of the AJAX Control Toolkit that is built for ASP.NET 3.5

Note: There are separate versions for ASP.NET 2.0 projects and ASP.NET 3.5 projects.

If your are running Windows Vista, Right-Click the .zip file, select properties, and "Unblock" the file.

Then unzip the files to the location of your choice.

Make sure the Visual Studio Toolbox Tab that you create for the controls is with the 3.5 version.

Now you need to upgrade your project to use the new tool kit. The easiest way to do this is to let Visual Studio do it for you.

SWITCH TO SOURCE VIEW and drag and drop any Ajax Control Toolkit control into your page.

35Up-9

When you get this dialog SELECT APPLY TO ALL ITEMS and click yes.

Then delete the control you just added.

UpTKVer

Visual Studio will have updated your controls reference and you should now be good to go !

Currently rated 4.8 by 5 people

  • Currently 4.8/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | Joe Stagner [Syndicated]

Related posts

Comments

3/25/2008 11:20:33 PM

Or you can simply add this lines to your web config

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

Petr Šnobelt

3/26/2008 5:21:54 AM

Thanks Dear Joe,I Had this Problem.

Armin

3/26/2008 5:23:08 AM

YOu're very welcome - thanks for commenting. If a blog post helps ONE person save an hour then it's worth the time !!!

JoeStagner

3/26/2008 7:50:29 AM

This is going to save me a lot of time when we move to the 3.5 from 2.0 .net in the coming months.

Thanks Joe!

Tanner

3/31/2008 2:28:01 AM

thanks joe
i have a problem this problem
Error 2 'ScriptManager' is ambiguous in the namespace 'System.Web.UI'.

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\project1\2e73529f\96250f4f\App_Web_5dpy7eyr.0.vb 156

please can you help me

paul

4/7/2008 4:53:27 AM

Thanks Joe!
This is going to save me a lot of time.

Love your videos 2 ,Thank you VERY much!

Biker cn

4/17/2008 12:25:30 AM

Hi Joe:
Thanks for your great videos on asp.net. and the blogs.
I tried to upgrade a 2.0 project, where I had reference of earlier version of toolkit, now I copied the new toolkit for 3.5 as you have said. Now, when I try to build the project I get the following Error:

The type 'System.Web.UI.ScriptManager' exists in both 'c:\Windows\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\Windows\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll'

most of the solution in google to go back to earlier version, which I dont want to do. Do you have any idea, how can I get rid of this issue ?
Thanks in advance.
KM

KM us

4/17/2008 11:26:09 AM

Sometimes you have to fudge the web.config a bit.

Try deleting the reference to the 1.0.61025 version. Then build. If you get an error that it can't find System.Web.Extensions, then grad a seconf UpdatePanel control onto your form. Then delete it and build again.

JoeStagner us

4/17/2008 11:41:05 AM

Joe:
Thanks a lot for your reply. I had a older version of the System.Web.Extension.dll in the bin directory of my project. I deleted it, and everything build successfully.
Thanks again for your hints.
KM

KM us

4/17/2008 4:32:55 PM

Glad to help !

JoeStagner us

5/6/2008 8:45:15 AM

Joe, Its cool to see someone using the BlogEngine.Net

I got a question for you. I did what you said and have been stuck on this problem for about 5 or six hours. When I remove the references as you said, I get the following error.

A ScriptManager is required on the page to use ASP.NET AJAX Script Components.

Basically it means from what I think, it can't find the script manager, but I got one up front and on the page. Then when I switch back from your changes, I get the error that brought me to this page from Google.

"'ScriptManager' is ambiguous in the namespace 'System.Web.UI'." 3.5.0.0

Wanna help me out?

Scott us

5/6/2008 8:53:20 AM

Okay,

So I just used what Petr Šnobelt posted in the first comment here and it all worked perfectly! Thank you Peter.

Scott us

6/5/2008 6:56:47 AM

The other thing that can cause this is leaving the text xmlns="schemas.microsoft.com/.NetConfiguration/v2.0" in the <configuration> section of the config file - which seems to do something with the namespaces and thereby causes the ambiguity with the script manager no matter what you do with components and references

Richard gb

6/6/2008 3:38:14 PM

:~( I have been working on this for 2 days now and nothing is working. I remove the reference in fact I remove both reference and I have added other components and both references are right back in the properties. I have tried to add Petr’s code but that errors out on me too. I don’t see a reference in the bin folder to remove it there either. This is my first exposure to AJAX and I really could use any help or suggestion. Is there any way I can uninstall the older version?

Roberta us

6/7/2008 11:03:34 AM

RLarson - contact me direcly and I'll see what I can do to help.

JoeStagner us

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About your host.

Name of author Joe Stagner
?????

E-mail me Send mail

Calendar

<<  October 2008  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Pages

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in