I'm trying to find a way of being able to use multiple versions of Visual Studio on the same set of projects. The majority of our team uses 2008, but I am trying out 2010. All projects are C#.
As I understand it Visual Studio 2010 insists on upgrading all projects, so it's not possible to leave all the solution/project files as 2008 versions. I really don't want to branch the entire source tree, so I'd like to find a way for multiple versions of the project files coexisting. Currently, I've duplicated all .sln and .csproj files so I have:
# 2008 versions
SolutionName.sln
ProjectA.csproj
ProjectB.csproj
# 2010 versions
SolutionName.vs2010.sln
ProjectA.vs2010.csproj
ProjectB.vs2010.csproj
The trouble is, despite the 2010 versioned files all having the same assembly names as their 2008 counterparts, Visual Studio (2010) believes the projects are all ProjectName.vs2010
. Renaming the project in VS fails with a message saying a file of the same name already exists.
I don't think putting the 2010 version in a sub-folder would be a solution as it would screw up any relative paths in the files.
So:
UPDATE
My initial claim was wrong that Visual Studio was failing to find the project references because it was using the file name. The specific problem I was having was that in my build files the project references were of the form:
<ProjectReference Include="..\..\path\to\ProjectName.vs2010.csproj">
<Project>{48354450-2462-449D-8B32-EFECA39F6CD7}</Project>
<Name>ProjectName</Name>
</ProjectReference>
The project files that I copied apparently have a different ID (or whatever it is in the <Project>
element. Simply removing the element from the build file has solved that particular issue:
<ProjectReference Include="..\..\path\to\ProjectName.vs2010.csproj">
<Name>ProjectName</Name>
</ProjectReference>
Having said that, the whole process of duplicating the project and solution files has actually been more effort than it's worth, so I'm not recommending this approach.
The term side-by-side means that you can install and maintain multiple versions of a product on the same computer. For VSPackages, that means a user can have several Visual Studio versions installed on the same computer.
Yes, this is possible. You can install Visual Studio versions side-by-side. However, Microsoft is recommending to install the old version first before you install the later version. We recommend that you install Visual Studio versions in the order in which they were released.
You can install Visual Studio on a computer that has an earlier or later version of Visual Studio already installed.
You can use more than one installation in the same computer, which one with their own extensions and configurations settings. To do that, you will need to use VSCode as portable installation.
Do you often modify the projects?
You could simply work with your upgraded version of the csproj and sln files. This way you would commit/check-in all changes to source code files except for the project files, which are not often modified anyway (except to add new files).
Then if you want to commit the changes in the project files, you'd work with an intermediate local VS2008 version of the file and line it up using your favorite diff/merge tools before eventually committing this VS2008 version. It would be some kind of local branch.
Unless you absolutely have to work with different versions of Visual Studio, those of the team still using 2008 could upgrade to Visual Studio 2010 Express. It's free for commercial use, and lacks only a few advanced features you might not need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With