Why does Visual Studio 2010 convert my projects?
Hi, I am Richa Prasad and I am the Program Manager for the Project System team. This means that I work on many features for managing projects and solutions. One such feature is the conversion process. We have recently received many requests for making the conversion process optional; i.e. supporting the ability to open old Visual Studio version projects in a newer Visual Studio version without the need to convert. We call this round-tripping. This blog post is an attempt to capture the questions that have been asked and our answers to them.
What is round-tripping?
Round-tripping is the ability to use a current or previous version of Visual Studio to target a platform that is supported by both versions of VS. For example, with round-tripping, you can open projects from a previous version of VS in a newer IDE without the need for conversion, thus allowing you to work side-by-side on old and upgraded projects.
Why is round-tripping not supported in VS2010?
The difficulty in supporting round-tripping does not lie in the solution and project files but rather the files that they reference. There are two key problems when trying to address round-tripping of projects and solutions between versions of Visual Studio:
1. Correctly handling projects, solutions and the files they reference when operating in a newer environment.
For instance, Visual Studio runs custom tools such as single file generators for designers in order to output code representing the changes made to the designer. Many of these custom tools are upgraded or completely replaced in the newer IDE. During conversion, the IDE knows which custom tools to replace or upgrade. In order to make round-tripping work, VS would need old and new custom tools to understand each other so as to ensure that old and new designers can work side by side. Other than designers, the following files would also be affected: resource editors, wizards, code snippets, item and project templates, diagramming and modeling tools, and many more.
2. Any changes that may be required in the older version of VS to support upgraded file round-tripping and to offer an appropriate user experience where files have been modified (or even upgraded).
Let’s assume that half the projects in a solution have been upgraded to target .NET Framework 4, and half target .NET Framework 3.5. When this solution is opened in VS2008, a key consideration is how VS2008 will deal with projects that target a framework it knows nothing about. Other than such aforementioned multi-targeting considerations, there are also IDE upgrades that need to be accounted for when opening an upgraded solution in an older IDE. For instance, VS2008 will not work with upgraded designers that contain code from VS2010 since it does not recognize the code that has been generated by VS2010 designer custom tools.
I don’t see a lot of difference between my project files. I can hand-edit it back to work with VS2008. Why can’t VS do this for me?
The solution and project files may not have changed significantly but the files that they reference have changed. For instance, if you have designer files in your project, even if you hand-edit the project and solution files to work with an older VS, the designer files will not work.
Does this mean that as long as I don’t use designers, I can manually hand-edit files to do round-tripping?
No. If your projects have undergone a conversion process, their content may no longer be valid in an older VS. For example, during the VS2010 conversion process, test projects are automatically retargeted to target .NET Framework 4. Thus, hand-editing project and solution files to be VS2008 compatible would not enable test projects to once again work in VS2008. Another example is C++ projects where .vcproj, .rules and .vsprops files are replaced during conversion. There are many such changes that happen to files during the conversion process.
What do you recommend to companies that have some developers using VS2008 and some using VS2010?
We recommend keeping your solutions separate – one set of developers can work on one codebase, while another set of developers can work on another codebase.
If I want to evaluate VS2010 on my existing projects, how do you recommend I do that?
We recommend setting up your code in source control or a virtual machine, or creating a backup before conversion. In general, we do offer a backup option in the conversion wizard.
When is round-tripping going to be supported in VS?
We will be seriously considering round-tripping as a feature in the next release. However, we are only in the early stages of planning for the next VS version.