A fresh dev machine fails to build our .net-framework-3.5-project on VS2019. Here's a dump of our investigation so far.
- Diffing a verbose log from this machine against a working machine, we get this line early in the log, only on the failing machine:
Property reassignment: $(TargetFrameworkSDKToolsDirectory)="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\" (previous value: "") at C:\Program Files (x86)\Microsoft Visual studio\2019\Professional\MSBuild\Current\Bin\ Microsoft.NETFramework.CurrentVersion.props (90,5)
- As a result (?) many times later in the log the failing machine shows
TargetFrameworkSDKToolsDirectory = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\
While a working machine shows
TargetFrameworkSDKToolsDirectory = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\
- Looking into Microsoft.NetFramework.CurrentVersion.props, the relevant lines show -
<TargetingClr2Framework Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'">true</TargetingClr2Framework> <MSBuildManagedCompilerPath Condition="'$(TargetingClr2Framework)' == 'true'">$(MSBuildFrameworkToolsRoot)\v3.5</MSBuildManagedCompilerPath > <TargetFrameworkSDKToolsDirectory Condition="'$(TargetingClr2Framework)' == 'true'">$(SDK35ToolsPath)</TargetFrameworkSDKToolsDirectory> <!-- If the sdk path is not 3.5 or lower set it to the 40 sdk tools path. This will allow future target framework versions to use the 4.0 sdk tool set When a new windows SDK revs they will inplace update the location pointed to by this property. When a new sdk is release this target will have to be revised along with another toolsversion. --> <TargetFrameworkSDKToolsDirectory Condition=" '$(TargetFrameworkSDKToolsDirectory)' == '' ">$(SDK40ToolsPath)</TargetFrameworkSDKToolsDirectory>
So it seems like for some reason the failing machine didn't catch the TargetFrameworkVersion value of this project as v3.5.
Not sure the choice of a toolset should have made any difference, but it does (probably a different bug).
The MSBuild registry keys and VS2019/MSBuild folders are identical on working and failing machines.
Before we go reinstalling multiple VS versions - does anyone have an idea what might be causing it or how to diagnose deeper?