Visual Studio 2015 solutions backwards compatibili

2019-01-11 00:39发布

问题:

It seems that I can open a VS 2013 solution file in VS 2015. I've a few questions regarding backwards compatibility:

  • Can a VS 2013 solution be maintained in VS 2015 safely without losing the capability to work on it in VS 2013?
  • Can a VS 2015 solution be maintained in VS 2013?

I can try it out all myself, but I would like to know if there are some documented caveats I should be aware of.

回答1:

I finally found official docs on files supported when upgrading solutions in Visual Studio in the MSDN article Porting, Migrating, and Upgrading Visual Studio Projects.

The key takeaway here is in the opening paragraph.

If you use Visual Studio 2015 together with Visual Studio 2013,Visual Studio 2012 or Visual Studio 2010 SP1, you can create and modify projects and files in any of the versions. You can transfer projects and files among the versions as long as you don't add features that are not supported by one of the versions.

You can run the same solution in different versions of Visual Studio as long as you don't implement a feature in a higher version that is not supported in a lower version.

This applies not only to VS 2015-2013 compatibility, but also to VS 2012 and VS 2010 SP 1 as well.


As a side note, I came across this while trying to open my report projects in VS 2015. The article also gives a breakdown of the compatibility between specific kinds of files between VS versions.



回答2:

I feel this is a legitimate question; I've not seen any official information from Microsoft regarding round-tripping solutions between the two IDEs, other than to "assume it works".

From my personal experience in the last 24 hours, "upgrading" the solution file with VS2015 causes no harm in and of itself; it changes the version number in the solution file and it re-sorts things but it doesn't add/remove anything else.

It will try and change some csproj files if they are tagged with an older tools version, but things still compile.

Unfortunately, we have made little progress with VS2015 because we rely on Microsoft fakes for stubs, and there appears to be at least one bug with that tool that is stopping us from continuing (see Visual Studio 2015, Microsoft Fakes and System.Security.Claims.Claim).