Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can newer versions of MSBuild compile older C# solutions?

I've inherited a set of build scripts which currently look inside the .sln file, work out what version of Visual Studio they were created with, and then call the version of MSBuild associated with that version of VS.

Is that necessary? Or will the latest version of MSBuild compile older solutions/projects?

like image 941
Andrew Ducker Avatar asked Sep 17 '25 12:09

Andrew Ducker


1 Answers

Can newer versions of MSBuild compile older C# solutions?

The simple answer is yes.

When building the project from Visual Studio, Visual Studio will call devenv.exe to build the project, then devenv calls msbuild to perform the build.

As per official document Port, Migrate, and Upgrade Visual Studio Projects:

Each new version of Visual Studio generally supports most previous types of projects, files, and other assets. You can work with them as you always have, and provided that you don't depend on newer features, Visual Studio preserves backwards compatibility with previous versions like Visual Studio 2015, Visual Studio 2013, and Visual Studio 2012.

Support for some types change over time, however. A newer version of Visual Studio may no longer support certain types, or require that they be migrated and updated such that they're no longer backwards-compatible.

So the latest version of MSBuild supports most previous types of older solutions/projects except those no longer support by the newer version of MSBuild.

like image 154
Leo Liu-MSFT Avatar answered Sep 20 '25 03:09

Leo Liu-MSFT