When building a project that targets the 2.0/3.0/3.5 Framework we try to use the tools defined by the $(SDK35ToolsPath) property:
https://github.com/microsoft/msbuild/blob/d42d3504057ef2b88dd4f68c4bfc5591371bd6fe/src/Tasks/Microsoft.NETFramework.CurrentVersion.props#L85
which we read from the registry. However, if the 3.5 development tools aren't installed then we won't find the value in the registry, $(SDK35ToolsPath) will not be defined, and we will silently "upgrade" to the 4.x tools instead:
https://github.com/microsoft/msbuild/blob/d42d3504057ef2b88dd4f68c4bfc5591371bd6fe/src/Tasks/Microsoft.NETFramework.CurrentVersion.props#L90
This can cause problems, such as using the wrong version of tlbimp to generate interop assemblies (which subsequently won't load at runtime).
We should instead detect and warn the user (or maybe even emit an error) when the 3.5 tools aren't installed.
When building a project that targets the 2.0/3.0/3.5 Framework we try to use the tools defined by the
$(SDK35ToolsPath)property:https://github.com/microsoft/msbuild/blob/d42d3504057ef2b88dd4f68c4bfc5591371bd6fe/src/Tasks/Microsoft.NETFramework.CurrentVersion.props#L85
which we read from the registry. However, if the 3.5 development tools aren't installed then we won't find the value in the registry,
$(SDK35ToolsPath)will not be defined, and we will silently "upgrade" to the 4.x tools instead:https://github.com/microsoft/msbuild/blob/d42d3504057ef2b88dd4f68c4bfc5591371bd6fe/src/Tasks/Microsoft.NETFramework.CurrentVersion.props#L90
This can cause problems, such as using the wrong version of tlbimp to generate interop assemblies (which subsequently won't load at runtime).
We should instead detect and warn the user (or maybe even emit an error) when the 3.5 tools aren't installed.