Round-tripping with Visual Studio 11

Round-tripping with Visual Studio 11

Rate This
  • Comments 20

About two years ago we wrote a blog post entitled Why does Visual Studio 2010 convert my projects? One of the strong pieces of feedback we received was that you wanted to be able to work on your projects using both the current and previous version of VS. We are delighted to announce that Visual Studio 11 will allow you to easily round-trip your projects with Visual Studio 2010 SP1! This means you can leverage the features of Visual Studio 11 while collaborating on the same projects as your team members who may still be using Visual Studio 2010 SP1.

When we embarked upon enabling round-tripping, we realized that implementing the feature boils down to accomplishing three goals:

  • Visual Studio 11 just works with existing Visual Studio 2010 projects
  • It is easy and desirable to upgrade to Visual Studio 11
  • Teams can use both Visual Studio 11 and Visual Studio 2010 at the same time

The key to achieving these goals is to answer one question – whether a project can leverage the same set of tools in Visual Studio 2010 and Visual Studio 11, and exhibit the same design-time and runtime behaviors. In Visual Studio 2010, we enabled full multi-targeting which severed the one-to-one tie between Visual Studio and the .NET runtime. This allowed projects created in Visual Studio 2010 to target older .NET Frameworks, and took us halfway towards enabling round-tripping of projects between Visual Studio versions. In Visual Studio 11, we took the next natural step of correctly handling projects when operating in different environments.

As we iterated through all the assets shipped in Visual Studio, we realized that to provide a seamless round-tripping experience, we would need to service Visual Studio 2010 so that it could offer the appropriate user experiences when handling projects which have been modified, or even upgraded. For instance, Web projects in Visual Studio 2010 specified the path to their build targets with a hard-coded “v10.0”. This would obviously not work if Visual Studio 2010 Web projects were to round-trip with Visual Studio 11 where the “v11.0” build targets are used. The resolution was to replace the hard-coded Visual Studio version string in the build targets path with a $(VisualStudioVersion) property which would dynamically change its value based on the environment in which Web projects are loaded. Visual Studio 2010 had to be serviced so that it could recognize and honor this new property.

With every new Visual Studio release comes a new set of language features which are baked into the compiler that ships with the .NET Framework as well as the compiler that ships within Visual Studio for IntelliSense and other purposes. For instance, Async is a feature which is baked into .NET 4.5 and Visual Studio 11. This means that if a project using Async is opened in Visual Studio 2010, build errors would occur as Visual Studio 2010 would not understand the new language features. This could lead to a confusing user experience where team members on Visual Studio 11 could unintentionally use new language features, check in seemingly successfully running code, but once the projects are run on a Visual Studio 2010 machine, they would fail to run.

While reviewing the experiences with every asset and feature shipped in Visual Studio 2010 and Visual Studio 11, we realized that to provide a seamless round-tripping experience, we needed to place two constraints on the feature:

  1. Round-tripping will only work between Visual Studio 2010 SP1 and Visual Studio 11
  2. All projects targeting .NET 2.0 to 4.0 and Silverlight 4 to 5 can round-trip.

Once the constraints were in place, we determined that there are four categories of projects: (1) those that can round-trip seamlessly, (2) those that require behavioral modifications to round-trip, (3) some that cannot round-trip, and (4) a few that are deprecated in Visual Studio 11. The rest of this blog post will elaborate upon each category and describe the experience we have designed for it.

Category 1: Round-trips seamlessly

The majority of projects fall into this category. These are projects that will just open in Visual Studio 11 and behave exactly the same as they did in Visual Studio 2010 SP1. You can reopen them in Visual Studio 2010 SP1 where you will find that the modifications you made in Visual Studio 11 are persisted, and the project continues to behave as it did in Visual Studio 11.

Within this category are two types of projects:

  1. Require no modifications at all: these projects will not be touched at all when loaded in Visual Studio 11. An example is a Windows Forms project.
  2. Require modifications that won’t change project behavior: these projects have a hard-coded Visual Studio version in their build targets path which needs to be replaced with the $(VisualStudioVersion) property in order to enable round-tripping. Visual Studio 11 will automatically do the modifications upon project load and backup the modified files in the solution directory. If these projects are under source control, they will be automatically checked out and edited. These modifications enable round-tripping while not affecting your project behavior. An example is an MVC 3 project.

Category 2: Requires behavioral modifications to round-trip

In order to load these projects in Visual Studio 11, modifications are required which will change project behavior. However, after the modifications, these projects will seamlessly round-trip with Visual Studio 2010 SP1.

When you load these projects in Visual Studio 11, you will see the Review Projects And Solution Changes dialog. For example, when loading a Silverlight 3 project in Visual Studio 11, the Review Projects And Solution Changes dialog will appear as Visual Studio 11 does not support Silverlight 3, and hence the project needs to be retargeted to Silverlight 5.

ChangesNeeded

The following features of this dialog merit notice:

  • To learn more about the statuses, you can hover over them which will invoke a tooltip explaining what they mean.
  • If you are still unclear about the changes being made to your project, you can click on More Information which will take you to the MSDN help page that lists all the project types in Visual Studio and the changes that will happen to them in order to load them successfully in Visual Studio 11.
  • If you need to consult your team before committing to migration, you can right-click in the middle pane of the dialog and choose Copy Information which copies the content of the dialog onto your clipboard. The content copied onto the clipboard lists all the projects in the solution. The ones that did not appear in the dialog fall into category 1: round-trips seamlessly.
  • Use the checkboxes to specify which projects you want to migrate. The unchecked projects will be left unloaded in the Solution Explorer with a ‘needs conversion’ message. You can reload these projects which will trigger the Review Project And Solution Changes dialog to reappear.
  • After migration, all the modified files will be backed up in the solution directory. A migration report will be created and saved in the solution directory but it will only be launched in the web browser if there were any migration errors or warnings.

Once migration is complete, the project will open back in Visual Studio 2010 SP1 without any issues. In the case of this Silverlight project, it will be retargeted to Silverlight 5 and will continue to round-trip seamlessly with Visual Studio 2010 SP1 as long as the Silverlight 5 tools are installed on the Visual Studio 2010 SP1 machine.

Category 3: Does not round-trip

These projects cannot exhibit the same runtime and design-time behavior when opened in Visual Studio 2010 SP1 and Visual Studio 11. When these projects are opened in Visual Studio 11, the Review Projects And Solution Changes dialog will appear informing you that a one-way upgrade is needed. For example, since VS SDK projects are utilized to create extensions for a particular version of Visual Studio, it follows that the projects themselves need to be run in the targeted Visual Studio version.

UpgradeNeeded

After migration, these projects will not round-trip and opening them in Visual Studio 2010 SP1 will result in failure to load and an ‘incompatible’ message.

Incompat

Category 4: Deprecated projects

These project types are not supported in Visual Studio 11. Opening deprecated projects will launch the migration report in the web browser.

report

In the example above, each deprecated project is reported as an error. The links will take you to the help page for that project type which will help you migrate your assets in the deprecated projects to Visual Studio 11.

References

The Visual Studio 11 Compatibility help page lists all project types and file types, and the kind of changes, if any, that are needed for them to successfully load in Visual Studio 11. If you own a project system and want to participate in the round-tripping infrastructure, please refer to the How to: modify a project system so that projects load in multiple versions of Visual Studio help page.

As always, feedback is welcome! You can leave your comments on this blog post and file bugs on Microsoft Connect.

 

goldendate

Richa Prasad – Program Manager, Visual Studio Pro team

Short Bio: Richa Prasad joined the Visual Studio team in 2009. She has been working on the Project and Build team since then, where she drives the experiences around project capabilities and MSBuild. Prior to joining Microsoft, she was in graduate school at University of Washington where she worked on sensor networks projects in collaboration with Intel Research.

Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post
  • Richa, I notice there is no mention of setup and deployment projects not being supported, but unfortunately not a single one of my VS 2010 solutions could be migrated to VS 11 because they all contain setup and deployment projects. Has Microsoft really forsaken us?

  • I see a lot of space to actually write "Silverlight 3 -> Silverlight 5 upgrade" in that "Changes needed" dialog. Hover is a way to provide more details, not to hide really important ones.

    Does Copy Information copy the reason and details about required change?

  • @Owen: Setup projects are indeed deprecated in VS11. You can use an importing tool to convert setup projects to ISLE projects. For details, see msdn.microsoft.com/.../2kt85ked(v=vs.110).aspx which is linked on the Visual Studio 11 Compatibility page I mentioned in the blog post.

  • @Andrey: Thanks for the feedback. Hovering over the statuses only tells you what will happen to all the projects in that category. For instance, hovering over Changes Needed shows a tooltip which says the projects will be modified such that project behavior is impacted but after the changes, the projects will round-trip with VS2010 SP1. Copy to Clipboard will copy the statuses and the message in the tooltip.

    For details on what modifications will happen per project type, you will have to look at the Visual Studio 11 Compatibility help page mentioned in the blog post. Many of the modifications require more than a couple of words to explain and there is no visually easy way to fit that into the dialog and still maintain clarity. This is why the details of the modifications are in the web page linked in the dialog via the "More Information" link.

  • Hope MS provides the same flexibility with VS 10/11 theme. I hate metro gui of VS11

  • But unfortunately, since Microsoft decided to make it so that .NET 4.0 and 4.5 can't exist side-by-side, this concept only works in theory. In practice, breaking changes in .NET 4.5 make it so that I'll never really be able to use both Visual Studio 2010 and 2011 on the same machine with peace of mind.

  • Nice in principle, but hardly the truth, experimentation has shown that round tripping works with only a very limited subset of the available projects in VS. I've had .NET projects fail to round trip because of SDK version issues (VS 11 would not compile a project targeting the Windows SDK 7.1), ditto with C++. If a C++ project had (past tense, as in the target was removed) at any point an Itainium target, it will fail to open in VS11.

    I hate to say this but the round tripping is really an empty promise if it simply doesn't work in the majority of scenarios.

  • In my opinion being able to open, debug and compile projects of other versions of Visual Studio is main key to sell it.

    For instance at work we have not switched from VS2005 since many features require that version and so we are stuck with it unless we decide to take a develpment time of 6 months (or more) to fix all the issues and buy all the updated components. For that effort our clients see no benefit.

  • @Josheinstein,

    Thank you for the feedback. Note that .NET Framework 4.5 is compatible with .NET Framework 4. All .NET Framework 4 apps will continue to work on .NET Framework 4.5.

    Visual Studio 2010 and Visual Studio 11 will work seamlessly on same machine with .NET Framework 4.5.

    Let us know if you encountered any issues.

  • Hey guys,

    This is really great. Unfortunately, Visual Studio 11 still wants to change my Visual Studio 2010 solution file in order to work properly. Which means that we should maintain two different solution files and sometimes this can be really inconvenient.

    Apart from that the integration between these two versions looks great.

  • @Emil - We have made some fixes to not scramble the solution file. The fix will be available in the RTM release of Visual Studio 11.

  • How about web deployment projects? It shows them as unsupported - is there any chance of supporting them or a migration path?

  • Richa - another vote for setup/web deployment projects, or at least some better walk throughs and examples for how to upgrade. I've already looked at the link in your 28 March reply, but drilling down to ISLE feature set it's not going to be enough without purchasing a more functional edition.

    WIX would appear to be the other option, but it's not even mentioned despite (I believe) being a CodePlex MS spin off.

    What would be great would be a WebSetup > Web Deploy and/or a Setup project > Wix migration wizard.

  • Unfortunately there is no WiX migration wizard but you can use Dark.exe (which is part of the WiX toolset) to decompile the MSI that you built using VS setup projects into WiX source files (.wxs files), then use Votive (the VS IDE plug-in for WiX) to load your .wxs files. This would give you a good starting point.

  • Hi robert ivanc, I am the PM owner for Web Publishing. Just wanted to give you a quick heads up regarding Web Deployment Projects (WDP). We have not yet finalized on our long-term plans regarding WDP, but I can tell you that we will not be able to get the support in time for VS 11 RTM. One of the items that we have on our radar post VS 11 RTM is to provide a first class publishing support for Website Projects. We are hoping that we can deliver that which would lessen the needs for WDP. If you don't mind could you share your WDP related scenarios with me over email to ensure that we have all of our bases covered? My email is sayedha [at]{MicrosoftDOTcom}.

    Thanks,

    Sayed Ibrahim Hashimi | http://sedodream.com/

Page 1 of 2 (20 items) 12