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?
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.
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