Visual Studio 11 Developer Preview - Project Backward Compatibility (Round-Tripping)

Tips Search

Visual Studio 11 Developer Preview - Project Backward Compatibility (Round-Tripping)

  • Comments 21

 

[ NOTE:  This post has been depricated.  The new, updated post can be found here:

http://blogs.msdn.com/b/zainnab/archive/2012/06/05/visual-studio-2012-compatibility-aka-project-round-tripping.aspx ]

 

image

 

UPDATE 3/8/2012:  As of the Beta this does not work with all project types.  Most notably web projects are not supported currently for this feature.  For more information on what is supported and what isn't look here:

http://msdn.microsoft.com/en-us/library/hh266747(v=VS.110).aspx

 

Probably one of the most welcome new features in VS11DP is the new project backward compatibility feature also known as project round tripping.  Let’s dig into the details.

 

The Old Days

In all prior incarnations of Visual Studio if you had an older version, VS2008 for example, and opened up the project in a newer version, VS2010 in this case, you had the option to convert the project.  If you did the conversion it was a one-way trip.  You couldn’t open the project again in VS2008 if you tried to go back.  This has been the source of a lot of pain and suffering for developers who have to work with multiple versions of Visual Studio.  We want the cool features of the latest IDE but still want others on our team to be able to open the solution in the older version of Visual Studio when they get the files from source control.

 

The New, Happy Days

You can now create projects in Visual Studio 2010 with Service Pack 1 then open those projects in Visual Studio 11 Developer Preview and THEN open the project up again in VS2010SP1.  In other words, we now have full project round-tripping capability so you can work with the latest features but still keep the solution compatible with and older version of Visual Studio. 

 

Putting it to the Test

Here are the steps you can take to test this for yourself:

  1. Create a project with Visual Studio 2010 with Service Pack 1 and put in a little sample code.
  2. Save and close the solution.
  3. Open the solution (CTRL + SHIFT + O) in Visual Studio 11 Developer Preview and add some more code.  Notice there is no longer a prompt to convert the project that appears.
  4. Save the close the solution.
  5. Open the project up again in VS2010SP1 and bask in the glory of project round-tripping.

 

Limitations / Observations

  • I know this works with Visual Studio 2010 Service Pack 1 but haven’t tested VS2010 with out the service pack.  I believe it will not work unless you have the service pack but am checking with the team.
  • You can’t use this feature with versions older than VS2010.
  • When you use any feature specific to the new version of Visual Studio, like changing the Framework to the latest version, then the project cannot be opened in the prior version.  I just changed the framework version from 4.0 to 4.5 for a project and saved it without many any other change and was not able to open the solution in VS2010.
  • Also, round-tipping isn't supported for TF Database projects.  VS11 wants to convert our .dbproj files into a new format....

  • 1) I can confirm you need the SP, I tried to open it in one VS without it. I am almost sure it's in the readme

    2) When I convert a big solution with solution folders, some projects are imported outside its folder.

  • Thanks Benjamin :)

    I talked to the VS team (Lisa F) the other day and the SP1 requirement is defintiely confirmed.  Not sure about the conversion issues as I haven't seen that problem yet.

    Z

  • and not supported on VS 2010 Architecture projects

  • I have been loving this feature since the developer release of VS11. I like to use some of the new features in VS11 while I still like to use VS2010 because I have all my add-ons and extensions setup and configured the way I like them.

    I'll usually open my solution in both VS' and then run the code duplication feature in VS11 then in VS2010 go into the code and make the changes necessary.

  • I'm guessing this is because VS11 is essentially VS10 with SP2.  It's great news, but I fear that when VS12 comes out, they'll break it.  At least we can enjoy it while it lasts.

  • Hey Dean :)

    I have to disagree that Dev11 is basically VS2010 SP2.  Certainly with each version we fix issues from the prior version but, given the large amount of new features added, this release will go far beyond that.  Just my .02

    Z

  • @deadlydog

    Roundtripping is supported for database projects! Yes, you will need to upgrade your VS2010 Database Project (.dbproj) to a new format, which is the database project type of SQL Server Data Tools (.sqlproj). But from there, you can work with the same project again in VS2010 SP1 if you install SQL Server Data Tools (get it here: msdn.microsoft.com/.../hh297027). It's a free download released for VS2010 users and we are working toward RTW alongside SQL Server 2012, and are also in VS11.

    SSDT is the next evolution of the database projects you worked with in VS2010, format has changed and a lot of improvements have been made. There are a few things that are not quite supported yet in SSDT and thus won't be upgraded, like data generation plans or data comparison files. The upgrade will backup your VS2010 database project so you won't lose those files.

  • Hi!

    I've just installed VS11beta and tried to open my solution (.NET 3.5, last saved in VS2010SP1) and VS11 touched all project files (updated the OldTools-Version and other stuff) and the version number of the designer files. Is this a bug in the round-trip feature? Because this behavior makes it impossible to work as a team with different studio versions and stil maintain a sensible list of changes during commits.

    Regards, Michael

  • I'm very interested in an answer to the same question as asked by Michael above. When opening my VS2010SP1 .NET 4.0 solution in VS11beta, VS11 touched the solution file and all project files. The solution appears to open fine in VS2010, but it makes it a bit of a hassle to have all those modified solution files "polluting" my Pending Changes list in TFS (and checking them in is _not_ an option at this time). And it'll be even more of a problem when I actually have to make a change and commit one of the project files, since I'll then have to do some manual hacks to only commit the correct things.

  • Michael / John,

    I'm looking into this with the team that works on this.  I'll work up an answer over the weekend and get back to this thread.

    Z

  • Thanks for the quick response zainnab. Looking forward to the feedback from the team over the weekend! And let me know if you could use some samples from the exact changes that appear. If you provide an e-mail address, I can send them to you.

  • Hey John :)

    Got some feedback from the team and they would like to know what types of projects you are seeing updated since not all project types are supported so far for this feature.  For example, if all the projects were web projects, then it’s expected for them to be checked out. I need to know the project type in order to know whether the modifications are justified or if we have a bug.  

    Z

  • Hi Zain!

    Thanks for the repsonse. Yes, I can confirm that it's only web-projects. I completly missed this the first time since I got overloaded with changed files list. I'm sorry about that (BTW, the async solution load is awesome in large solutions!) I did a thorough analysis now and here's what I've found. (I matches your statement and is actually better than that :) ).

    I can confirm that only it touches Web Application projects (C# and VB). Here's the affected file types:

    1. The project file:

    Here's the contents of a patch file. I hope it comes out OK. As you can see, opening the project added some stuff and changed the old tool's version. A more detailed analysis shows that it's actually safe to commit the changes. VS2010 won't try to revert them to the old format, even when editing the project (e.g. adding a file). So, I guess, it's just a one time compatibility impact.

    Index: Web.csproj

    ===================================================================

    --- Web.csproj (revision 22532)

    +++ Web.csproj (working copy)

    @@ -1,5 +1,6 @@

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

    <Project DefaultTargets="Build" xmlns="schemas.microsoft.com/.../2003" ToolsVersion="4.0">

    +  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

      <PropertyGroup>

        <ProductVersion>9.0.30729</ProductVersion>

        <SchemaVersion>2.0</SchemaVersion>

    @@ -29,7 +30,7 @@

        </FileUpgradeFlags>

        <UpgradeBackupLocation>

        </UpgradeBackupLocation>

    -    <OldToolsVersion>3.5</OldToolsVersion>

    +    <OldToolsVersion>4.0</OldToolsVersion>

        <SignAssembly>true</SignAssembly>

        <AssemblyOriginatorKeyFile>..\..\..\key.snk</AssemblyOriginatorKeyFile>

        <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

    @@ -382,6 +383,10 @@

      <ItemGroup>

        <Folder Include="Res\" />

      </ItemGroup>

    +  <PropertyGroup>

    +    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

    +    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

    +  </PropertyGroup>

      <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

      <PropertyGroup>

        <PreBuildEvent>

    @@ -407,5 +412,6 @@

          </FlavorProperties>

        </VisualStudio>

      </ProjectExtensions>

    -  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

    +  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

    +  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

    </Project>

    \ No newline at end of file

    2. Resource and Settings designer files:

    Apparently, here, too, only Web-Application project designer-files for Resources, Settings, etc are affected.

    It touches the Runtime Version in the header section. A test showed, opening the resource with VS 2010 doesn't revert the change, which is good. So, this leaves only one real issue: When you're actually editing the resources in VS2010, the new Runtime Version gets set. And when you then oven it in VS 11, it would touch the file once more. For me, that's a compromise I can live with, since I don't have that many resources in the solution I'd be developing with both VS version.

    Index: Resources.Designer.cs

    ===================================================================

    --- Resources.Designer.cs (revision 22532)

    +++ Resources.Designer.cs (working copy)

    @@ -1,7 +1,7 @@

    //------------------------------------------------------------------------------

    // <auto-generated>

    //     This code was generated by a tool.

    -//     Runtime Version:4.0.30319.1

    +//     Runtime Version:4.0.30319.17379

    //

    //     Changes to this file may cause incorrect behavior and will be lost if

    //     the code is regenerated.

    3.  ASPX-designer files.

    Also, the header in ASPX-designer files only gets touched by VS 11 when you edit the markup. And then VS2010 does not touch this new header at all. Which is _great_!

    Sorry, again, for the confusion.

    Regards, Michael

  • Michael :)

    Thanks for the update.  I'm glad you asked the questions as it clarified the feature for me as well.  :)  I'll let the team know all is well.

    Z

Page 1 of 2 (21 items) 12
Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post