Warn the user when building a project targeting 3.5 but the 3.5 SDK isn't installed
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 133
Description
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](https://developercommunity.visualstudio.com/content/problem/571032/target-framework-is-ignored-when-generating-intero.html) (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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.