Archive

Posts Tagged ‘Visual Studio 2008’

Converting an application to .Net 3.5 and Visual Studio 2008 from .Net 2.0 and Visual Studio 2005

December 24th, 2009 Arghya Mahapatra 1 comment

As this is my first step in .net 3.5 and Visual Studio 2008 both, so I was thinking why not just try with my existing web application in .net 2.0 which I daily work on using Visual 2005. Because creating a new application is not that much challenging I guess but converting an application from an older framework to latest framework is little bit challenging.

Before I put my 1st step I needed .net 3.5 framework and Visual Studio 2008 Professional Edition in my place. You can also get free downloads of .net 3.5 framework from Microsoft’s official site (you can use http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en ) and please buy a genuine copy of Visual Studio 2008 before you follow my steps bellow.

Step 1:

When you are ready with VS 2008 and .net framework 3.5 in your system and you have configured default setting in VS 2008, then you can open VS2005 solutions. So, go to File >> Open >> Project/Solution (Ctrl + Shift + O); Open Project dialog will be opened. Select a VS 2005 solution and open it. It will open a wizard to convert the solution from older version to new 2008 version.

1

 

Step 2:

Click Next to backup your current project. Check Yes, create a backup before converting radio give the location for backup

2

 

Step 3:

Click Next to finally complete the conversion.

3

 

Step 4:

Click Finish to complete the Wizard. It will open a Message Box and ask you to upgrade the project’s framework from .Net 2.0 to .Net 3.5.

4

 

Step 5:

Do not check the check box for all solutions unless you want it to convert all .net 2.0 solutions in .net 3.5 whenever you open it using VS 2008. Click Yes to upgrade the framework. You will get the Conversion Complete window of the wizard.

5

 

Step 6:

Check the checkbox to view the conversion log and click close button to close the wizard and open the Log like bellow screen.

6

 

Step 7:

So now you have completed all the steps. Your solution is converted to VS 2008 version and project framework is converted from .net 2.0 to .net 3.5. You can check all files and directories in your Solution Explorer. Now we need a build to run the application. Follow the steps to change the Target Framework to .Net 3.5 : Right Click on the Solution >> Select Properties >> Click Application Tab >>  Select .Net Framework 3.5 as Target Framework. Save the Properties and Build the application.

Step 8:

Now you may be thinking that I will tell you to configure IIS to run the application properly in .net 3.5. That's not required –  Since Net 3.5 is just an extension of .Net 2.0. So the same aspnet_isapi.dll of .net 2.0 is used. So, there is no change in IIS. In fact you will not get any option of .Net Framework 3.5 in IIS. (For more information http://blogs.msdn.com/vijaysk/archive/2008/03/20/running-asp-net-3-5-on-iis.aspx )

As web.config changes were taken care of by the wizard I don’t need to tell you the changes but if you want to see the changes you can check the following link

http://www.selarom.net/blog/2009-04-20/Ajax_Conflicts_Between_net_2_0_and_3_5.aspx

Now the time is to check the running application to confirm the successful conversion.  Yahoo I got the first screen of my application. I was pretty happy that time. My application was running in .Net 3.5.

Ooops! I got the bellow screen when I browsed one of the ajax page where I used ScriptManager.

7

 

To overcome this issue I deleted all my \bin filesand rebuilt the application. I browsed the application again and checked the same page and it was working fine. (For more details http://weblogs.asp.net/javiervillarreal/archive/2008/01/30/the-type-system-web-ui-scriptmanager-is-ambiguous-it-could-come-from-assembly.aspx)

I got stuck with another issue when I browsed a page where I used the Ajax toolkit. 

8

 

To fix the issue I downloaded the latest Ajax tool kit from http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36097 and copied AjaxControlToolkit.dll and System.Web.Ajax.dll from AspNetAjaxLibraryBeta0911\WebForms\Release to bin and then rebuilt.

Now I can smoothly run my old .net 2.0 web application in .Net 3.5 framework.

This post is written by Arghya Mahapatra. Arghya is a Tech Lead in the eCommerce Practice at Ignify. Ignify is a Global Microsoft Dynamics Inner Circle Partner specializing in ecommerce for Retail, Distribution, and Manufacturing businesses. Ignify has been included as the fastest growing business in North America for 3 years in a row by Deloitte, Inc Magazine and Entrepreneur Magazine.