views:

345

answers:

8

The small software team I work on recently got approved to upgrade to Visual Studio 2010 (we're currently using VS 2005). We have several ASP.NET 2.0 and WinForms (in .NET 2.0) projects in production.

I've been tasked with downloading VS 2010 and seeing how well it plays with our current projects. What issues should I be aware of when targeting older applications in VS 2010? If I open a VS 2005 project in VS 2010, will it still place nicely when my teammate goes back to open the project in VS 2005? Will we have to upgrade projects to work in VS 2010 (assuming the projects themselves aren't upgraded to .NET 4)? Can I use VS 2010 to edit legacy VB6 apps (just kidding)?

I'm excited to work with the newest software, but we're concerned about running into development snags on production applications that are already working just fine.

NOTE: I started a bounty in hopes of getting a more detailed answer to this question. Perhaps the answer really is as simple as those already provided, but I'm interested in more feedback regarding our options to transition from using VS 2005 to VS 2010.

+3  A: 

You will have to upgrade the project.

That will change the solution file so this solution can only be opened on VS2010 after upgrading.

Other than that I wouldn't expect any problems.

Foxfire
+1  A: 

It will modify the project file and therefore in can't be opened anymore in older versions of Visual Studio without editing that file (or make sure you've copies for each VS version).

Rhapsody
+7  A: 

You will certainly have to "upgrade" your project and solution files. This makes it difficult to have a mixed team on VS2k5 and VS2k10. The solution file and project files can no longer be opened in previous versions of visual studio after they've been upgraded.

You can get around this by having two copies of each of your solution and project files, but this is clumsy as obviously changes made to one will need to be copied manually to the other.

In addition, it seems that you won't be able to use any pre-.NET 4.0 nit test projects with VS2010. If you use MSTest to test pre-4.0 applications, that's an argument against moving to VS2k10 at all. You'd need to port your app to 4.0, or port your tests to e.g. NUnit.

There were some bugs in Beta 1 regarding the layout of the solution explorer. All of the ones listed on Connect are "fixed", but it's worth being aware that the upgrade wizard might make mistakes that you'll have to fix manually. Assuming your whole team is migrating to vs2k10 that kind of issue isn't a big deal as it's pretty obvious if something goes wrong, pretty easy to fix, and only happens once.

Iain Galloway
Testing? Isn't that what the F5 button is for? Seriously, though, while the unit test issues won't really affect our team, I'm sure that information will be invaluable to other users.
Ben McCormack
+2  A: 

Our company never had any problems moving our ASP.NET projects from 2005 to 2008 and so I wouldn't foresee any particular problems (though we haven't moved to 2010 yet, so bare this in mind). Most people I know have had the same experience. As others have mentioned, there is an automatic upgrade wizard that take care of upgrades for you, and it's always worked flawlessly for all projects I've upgraded . However, you won't be able to open the newly upgraded solution file in previous versions of Visual Studio (so back these up first if you want to retain them - though it may be possible to hack the .sln files to go back if really necessary).

You can, however, have multiple versions of Visual Studio installed at once (but remember that only one version can have default file extensions associated with it and this will likely be latest version you install). Incidentally, if you are interested in why you can't open older solutions in new version without conversion, then read this official VS Blog entry.

Remember, though, that Visual Studio 2010 allows you to target any previous version of the .NET Framework. So, if for some reason you wish your projects to stay at .NET 2.0 you can do so. However, in reality there is no real advantage I can see in this. Personally I think you just need to bite the bullet and upgrade everything - it's not really practical for people to use different versions for the same solutions.

Dan Diplo
+1  A: 

I moved a solution from 2005 to 2010 a couple of days ago. No issues at all, although it was a solution with a large number of small, simple, test projects. You wont be able to open the solution in 2005 though once you've done the conversion.

Russell Troywest
+2  A: 

Besides what was mentioned, take a look at .NET Framework 4 Migration Issues.

Daniel Rose
+2  A: 

When you convert a project from VS 2005 to 2008, or from VS 2008 to 2010, both the solution file and the project files are modified. But while the solution file can't then be opened with the earlier version anymore, the project files can.

Therefore, the best way to upgrade is:

  1. Navigate in the file system to your original solution (Original.sln).
  2. Make a copy of that solution file.
  3. Rename the copy so you know it's VS 2008 (e.g. OriginalVs2008.sln).
  4. Now do the upgrade process in VS 2010.

When the upgrade is finished, you'll be able to open your solution in VS 2010 (using Original.sln) or in VS 2008 (using OriginalVs2008.sln).

Just remember that you need to keep the solutions in sync; if you add a project to one, you'll need to add it to the other. But I've used this technique to share projects between VS 2005 and VS 2008, and it works fine. I've confirmed that a project created in VS 2008, then converted to VS 2010, still works in VS 2008 with a compatible solution file.

Kyralessa
These are good ideas. One thing I've been warned about is new language features in 2010 that may not work correctly in 2008. For example, in VB.NET 2010, you can continue code on a new line without adding a '_' character. If you were to write code like that in 2010 and then try to consume that code in VS 2008, I think it's going to through a compiler error.
Ben McCormack
You *think* it'll throw a compiler error? Test it and find out, as I did before claiming that my method above would work for upgrading.
Kyralessa
A: 

Hi,

We are migrating our 2005 solutions to 2010, we opened the solutions and after finishing the upgraded wizard and then changed the .Net version to 4.0, when we say build, it starts throwing 100s of errors:

1. 1st Error:

An assembly with the same identity 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' has already been imported.

Solution: open your csproj file in notepad and find in the

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> and
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
 add <NoStdLib>true</NoStdLib> and 
 then find Reference Tag and add <Reference Include="mscorlib" />.

2. The 2nd error:

Unable to delete file "bin\Debug\<>". Access to the path '<>' is denied.

which is not solved ... we have tried solutions present in the http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/40ed753e-47af-4638-8a72-1d607102a05c but still issue is not solved, we have to close VS 2010 then delete the files manually and then say build in the project, if we say clean or rebuild then it will give the same above error.

3. 3rd Error is:

When we executed the migration wizard in 2010 after that we saw that all the project references (not the dll references) are gone, so we have to open all the projects and again have to add the project reference for all the projects which is the most tedious work.

Ambuj Saxena