Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

16
Visual Studio 2005 Visual Studio 2005 and 2008 and 2008 coexistence coexistence Code Camp 2008 Code Camp 2008 Emmet Gray Emmet Gray http://home.hot.rr.com/graye http://home.hot.rr.com/graye

Transcript of Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Page 1: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Visual Studio 2005 and Visual Studio 2005 and 2008 coexistence2008 coexistence

Code Camp 2008Code Camp 2008

Emmet GrayEmmet Grayhttp://home.hot.rr.com/grayehttp://home.hot.rr.com/graye

Page 2: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

IntroductionIntroduction

Visual Studio 2005Visual Studio 2005 Designed for .Net Framework 2.0Designed for .Net Framework 2.0 Available Nov 2005Available Nov 2005 Subsequent add-ons for .Net Framework 3.0Subsequent add-ons for .Net Framework 3.0

Visual Studio 2008Visual Studio 2008 Designed for .Net Framework 3.5Designed for .Net Framework 3.5 Available Feb 2008Available Feb 2008

Page 3: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Backwards CompatibilityBackwards Compatibility

VS2008 can target multiple versions of the VS2008 can target multiple versions of the FrameworkFramework 2.0, 3.0, and 3.52.0, 3.0, and 3.5

The .Net Framework 3.5 is built upon 2.0The .Net Framework 3.5 is built upon 2.0 The “core” of the framework is still 2.0The “core” of the framework is still 2.0

New features of 3.x are (obviously) not New features of 3.x are (obviously) not available to 2.0 applicationsavailable to 2.0 applications

Page 4: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Why Co-existence?Why Co-existence?

VS2008 has reduced support for “classic” VS2008 has reduced support for “classic” ASPASP

Custom VS2005 adds-in may not yet be Custom VS2005 adds-in may not yet be available for VS2008available for VS2008 Manually edit the .addin fileManually edit the .addin file

Page 5: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Backwards CompatibilityBackwards Compatibility

VS2008 can target multiple versions of the VS2008 can target multiple versions of the FrameworkFramework 2.0, 3.0, and 3.52.0, 3.0, and 3.5

The .Net Framework 3.5 is built upon 2.0The .Net Framework 3.5 is built upon 2.0 The “core” of the framework is still 2.0The “core” of the framework is still 2.0

New features of 3.x are (obviously) not New features of 3.x are (obviously) not available to 2.0 applicationsavailable to 2.0 applications

Page 6: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Conversion WizardConversion Wizard

VS2008 will automatically convert a VS2008 will automatically convert a VS2005 project when openedVS2005 project when opened Will not automatically convert an older Will not automatically convert an older

VS2002 (v7.0) or VS2003 (v7.1) projectVS2002 (v7.0) or VS2003 (v7.1) project

The conversion is “one way”, so after The conversion is “one way”, so after conversion, you will no longer be able to conversion, you will no longer be able to open the project in VS2005open the project in VS2005

Page 7: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Problems with this approachProblems with this approach

Causes problems with shared source code Causes problems with shared source code (ie Source Code Control systems)(ie Source Code Control systems)

You may not be able to do a phased roll-You may not be able to do a phased roll-out of VS2008 among your VS2005 out of VS2008 among your VS2005 developersdevelopers

Users with only VS2005 can’t download Users with only VS2005 can’t download and use examples in VS2008 formatand use examples in VS2008 format

Page 8: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

SolutionsSolutions

Install VS2008 along side VS2005?Install VS2008 along side VS2005? Doesn’t solve the problem of accidentally Doesn’t solve the problem of accidentally

converting a shared projectconverting a shared project VS2008 is about 3.8 Gb for a full installVS2008 is about 3.8 Gb for a full install Defeats the purpose of the “targeting” featureDefeats the purpose of the “targeting” feature

Convert everyone to VS2008 simultaneouslyConvert everyone to VS2008 simultaneously

Use a standalone utility to convert between Use a standalone utility to convert between the two versions of Visual Studiothe two versions of Visual Studio

Page 9: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Designing a Standalone UtilityDesigning a Standalone Utility

Discover the differences between the Discover the differences between the solution and project filessolution and project files *.vbproj, *.csproj - uses the “MSBuild” schema*.vbproj, *.csproj - uses the “MSBuild” schema *.vcproj – uses the “Visual C” schema*.vcproj – uses the “Visual C” schema *.sln – not XML based, no schema*.sln – not XML based, no schema

Microsoft provides the documentation for Microsoft provides the documentation for the schemasthe schemas

Series of “file diffs” to detect the changesSeries of “file diffs” to detect the changes

Page 10: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Solution FilesSolution FilesMicrosoft Visual Studio Solution File, Microsoft Visual Studio Solution File, Format Version 10.00Format Version 10.00

# # Visual Studio 2008Visual Studio 2008

Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ProjectConverter“, Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ProjectConverter“, "ProjectConverter.vbproj", "{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}""ProjectConverter.vbproj", "{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}"

EndProjectEndProject

GlobalGlobal

GlobalSection(SolutionConfigurationPlatforms) = preSolutionGlobalSection(SolutionConfigurationPlatforms) = preSolution

Debug|Any CPU = Debug|Any CPUDebug|Any CPU = Debug|Any CPU

Release|Any CPU = Release|Any CPURelease|Any CPU = Release|Any CPU

EndGlobalSectionEndGlobalSection

GlobalSection(ProjectConfigurationPlatforms) = postSolutionGlobalSection(ProjectConfigurationPlatforms) = postSolution

{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}.Release|Any CPU.ActiveCfg = Release|Any {B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}.Release|Any CPU.ActiveCfg = Release|Any CPUCPU

{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}.Release|Any CPU.Build.0 =Release|Any CPU{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}.Release|Any CPU.Build.0 =Release|Any CPU

EndGlobalSectionEndGlobalSection

GlobalSection(SolutionProperties) = preSolutionGlobalSection(SolutionProperties) = preSolution

HideSolutionNode = FALSEHideSolutionNode = FALSE

EndGlobalSectionEndGlobalSection

EndGlobalEndGlobal

Page 11: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Solution Files (continued)Solution Files (continued)

Product Name Product Version File Format

Visual Studio .Net v7.0 7

Visual Studio .Net 2003 v7.1 8

Visual Studio 2005 v8.0 9

Visual Studio 2008 v9.0 10

File Format (schema) versions:File Format (schema) versions:

Page 12: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Project FilesProject Files<?xml version="1.0" encoding="utf-8"?><?xml version="1.0" encoding="utf-8"?>

<Project <Project ToolsVersion="3.5" ToolsVersion="3.5" DefaultTargets="Build" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup><PropertyGroup>

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

<ProductVersion><ProductVersion>9.0.210229.0.21022</ProductVersion></ProductVersion>

<SchemaVersion>2.0</SchemaVersion><SchemaVersion>2.0</SchemaVersion>

<ProjectGuid>{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}</ProjectGuid><ProjectGuid>{B637ACFD-0AFC-4FBB-A8C0-602B5ABA62F0}</ProjectGuid>

<OutputType>WinExe</OutputType><OutputType>WinExe</OutputType>

<StartupObject>ProjectConverter.My.MyApplication</StartupObject><StartupObject>ProjectConverter.My.MyApplication</StartupObject>

<RootNamespace>ProjectConverter</RootNamespace><RootNamespace>ProjectConverter</RootNamespace>

<AssemblyName>ProjectConverter</AssemblyName><AssemblyName>ProjectConverter</AssemblyName>

<FileAlignment>512</FileAlignment><FileAlignment>512</FileAlignment>

<MyType>WindowsForms</MyType><MyType>WindowsForms</MyType>

<TargetFrameworkVersion>v2.0</TargetFrameworkVersion><TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

Page 13: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

Project Files (continued)Project Files (continued)

Differences between versions:Differences between versions:

Element VS2005 VS2008

ToolsVersion Absent 3.5

ProjectVersion 8.0.50727 9.0.21022

OldToolsVersion Absent 2.0 (if converterd)

TargetFrameworkVersion Absent 2.0

Bootstrapper .Net Framework 2.0 .Net Framework 2.0 (x86)

ImportProjects $(MSBuildBinPath) $(MSBuildToolsPath)

Page 14: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

ProjectConverter UtilityProjectConverter UtilityStandalone applicationStandalone application Does not require VS2008Does not require VS2008

Converts project/solution files between Converts project/solution files between VS2005 and VS2008VS2005 and VS2008 Does not alter source code at allDoes not alter source code at all

Can be installed to gain a “shell extension” Can be installed to gain a “shell extension” for solutions files (*.sln) that offers an for solutions files (*.sln) that offers an “open with” option to launch the utility“open with” option to launch the utility

Page 15: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

ProjectConverter UtilityProjectConverter Utility

Quick tour of the source codeQuick tour of the source code

Page 16: Visual Studio 2005 and 2008 coexistence Code Camp 2008 Emmet Gray .

End NotesEnd NotesProjectConverter is a free utilityProjectConverter is a free utility Available as VB.Net and C# source code only, Available as VB.Net and C# source code only,

so you have to compile it yourselfso you have to compile it yourself

Source code is available at:Source code is available at:http://home.hot.rr.com/graye/Articles/ProjectConverter.htmhttp://home.hot.rr.com/graye/Articles/ProjectConverter.htm