Convert VS2008 to VS2010 C# Project

If you want to convert a C# project in Visual Studio 2008 to one in Visual Studio 2010 without going through the conversion process by opening it in Visual Studio 2010, then you simply need to open and edit two files in notepad.

First open the solution file and change the following two lines

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C# Express 2008

to

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010

and then open each project file and change the entry near the top of the file from

ToolsVersion="3.5" to ToolsVersion="4.0"

C# 2008 Starter Kits

I was pleased to see that most of the starter kits for Express  2005 work with 2008 without changing them. Here are a couple of links to some of the Coding4Fun ones.

Plus a whole raft from Microsoft

http://msdn2.microsoft.com/en-us/vs2005/aa718342.aspx

Simple Game – Simon

I originally wrote this port of the eighties game last year in C#, purely to get my head around shaped buttons. I put my code up on codeproject and here you can see the game itself.

simon_game.jpg

After sortng out my projects last week, this is one of the first projects I have reuploaded to the web. Download the source code or play the game offline.

Simon is a simple memory game that you try to remember the order in which the lights appear. The original also had sound, but I have not had time to put that in yet. Maybe version 2 will appear sometime.

Converting a C# Express 2005 Project to C# Express 2008

I decided to update all of the projects I have lying around to open in Visual C# Express 2008. I was a bit daunted by opening each project and converting it, so I thought, lets look at what files need changing. when it gets right down to it, only two file types need editing.

Firstly the solution (*.sln) file needs the following two lines changing from:

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C# Express 2005

to:

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C# Express 2008

Then any project file within the solution (*.csproj) needs the following lines changing from:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == " ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>

to:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>

Plus you need to add the following two lines to the first PropertyGroup tag

  <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
  <FileAlignment>512</FileAlignment>

Once this has been done, then the project opens in C# Express 2008 without having to go through the conversion process.

Installing C# Express 2008

I have written two short articles on installing C# Express 2008. One covers installing C# Express form an Offline Installation while the other covers installing the software from the Web.

I hope these are of use to people.

Follow

Get every new post delivered to your Inbox.