1

I know what and how MSBuild Toolset (ToolsVersion) works but don´t understand what would affect to our projects if changing/using a lower or highier ToolVersion from the project file or CLI.

Need to know the pro and cons Please...

Dante
  • 59
  • 1
  • 5

1 Answers1

1

what are the drawbacks of changing the MSBuild Toolset (ToolsVersion) in our .net projects?

As far as I know, ToolsVersion specifies the build mechanism for a particular version, and actually, this means building projects with different versions of MSBuild. See this link.

Such as:

VS2019(MSBuild 16.0):ToolsVersion=Current,VS2017(MSBuild 15.0):ToolsVersion=15.0, VS2015(MSBuild 14.0):ToolsVersion=14.0, VS2013:ToolsVersion=12.0.

However, each new release of MSBuild will have some new features and some special tasks that you can use in the proj file. Because of this, MSBuild supports downward compatibility, and the higher version of MSBuild supports compiling projects created with a lower version VS, as well as new features from previous lower versions.

For an example, if you create a new project in VS2015, you can use ToolsVersion 14.0,15.0 and Current without any errors.

If you use the lower ToolsVersion to build your project, it will turns some errors like Could not find the assembly reference xxxxxxx or missing DLL methods.

Therefore, we recommend that you use ToolsVersion(MSBuild) that is higher than the version of your current project rather than MSBuild that is lower than the version of your current project. And if your current project does not have any special version methods or features, and there is no problem with using a lower version, but this is not generally recommended. And use the latest version MSBuild to build your project, it may have a performance optimization and improvement.

Hope it could help you.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41