Upgrading ASP.NET Projects from VS2008 to VS2010

by jmorris 15. October 2010 17:44

I recently upgraded several solutions/projects from VS2008 to VS2010 and ran into a few snags. The following covers some of the issues I have run into and how I fixed them.

First thing I did was use the Visual Conversion  Wizard to convert the solution and projects from VS2008 to VS2010, which is pretty simple. Just write click on the solutions and select “Open with Microsoft Visual Studio 2010”:

image

You will be prompted with by the Visual Studio Conversion Wizard:

image

Select “Next” and then “Finish”. You will then be prompted with a dialog wanting to know if you want to upgrade Web sites that were configured to run under the an earlier version of VS (in this case 2008):

image

What this does is add the targetFramework entry to your Web.Config file to “4.0”, so that IIS knows to which version of .NET to run under:

image

After you answer “Yes” to these dialogs and assuming nothing went wrong with your conversion, the “Conversion Complete” dialog will appear:

image

Thus far, for me everything went according to plan, however when I went to build the solution I ran into some errors:

image

For some reason two of the references were not resolved, so using the “Add References” dialog I added the two references thinking they must have just become “unreferenced” and got the following error:

image

What the heck? Didn’t I just upgrade those to VS2010 (.NET 4.0)? Well, actually it turns out I did, however the other assemblies (this one included) were still compiling under .NET 3.5. So, pretty easy to fix, just right click on each project and select “Properties” and then on the “Application” tab select the appropriate .NET Framework:

image

You have to do this for each project in the solution. Now thinking that everything has been resolved, I built the projects and while I was expected a nice “Build succeeded” message, I got:

image

Yikes, that was not what I expected to see! Notice that all of the error’s were of the form:

“The type name 'X' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.”

All of the errors were related to code referencing ASP.NET’s Membership and Role API’s and the “This type has been forwarded to assembly ‘System.Web.ApplicationServices’ was a huge, massive hint as to what was going on. So I added a reference to System.Web.ApplicationServices:

image

And then I did another build which completed successfully.

Summary

The conversion in my opinion was pretty straight forward, even though I ran into a few scenarios that the Conversion Wizard could not handle. I am pretty experienced with  updating solutions/projects from previous versions of .NET; I could see where a somebody less experienced with VS projects and solutions would run into some trouble, but for the most part it was pain-free. As long as you read the error messages and consider what may be causing them, you shouldn’t run into to many problems.

Tags: , , ,

Visual Studio

Comments (3) -

Technology Blog
Technology Blog
11/23/2011 2:03:27 AM #

Just desire to say your article is as astonishing. The clearness in your post is simply nice and i could assume you\'re an expert on this subject. Fine with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.  Thanks !

Reply

As a business owner you have many challenges and responsibilities.  Using Internet technology correctly can help you grow your business and increase sales quickly and easily without a huge investment.  Evolve your business and start working less while making more by leveraging Internet technology in your marketing.

Reply

Robert
Robert
1/2/2012 8:05:19 PM #

Hey  social media has come a long way from being a mere outlet for sharing thoughts and images among friends and families. It has become a popular and effective method for business owners…

Reply

Pingbacks and trackbacks (2)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Who Am I?

My name is Jeff Morris a software engineer/developer in Southern California, USA. My platform du jour is dotnet, but I dabble on the darkside occasionally.

Tag cloud

Month List

Page List