Update: and the circle is completed
If you get an error that says.
WinSDK 7.0 (Windows SDK for Windows 7 and .NET Framework 3.5 SP1) is not installed, and it is required because WinSDK 8.0 or higher doesn't provide .NET 3.5 tools.
The paths might have changed slightly generating the error in error.
Start by removing the <Target...
below and try recompiling first before going further.
Original answer
According to this solution a bug in VS2017 that clears the registry key that would set $(SDK35ToolsPath)
and when it's clear the fallback is the 4.0 version.
The following comes from the linked solution. Note that editing the registry did not affect the results until after some time had passed. Simply restarting VS2015 did not
Update the Windows registry:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86\InstallationFolder
= c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0\bin
It's also suggested to catch this bug earlier by adding the following to your .csproj file.
<Target Name="CheckVariables" BeforeTargets="_CheckForInvalidConfigurationAndPlatform">
<PropertyGroup>
<WinSDK-70-NetFx35Tools-InstallationFolder>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v7.0\WinSDKNetFx35Tools@InstallationFolder)</WinSDK-70-NetFx35Tools-InstallationFolder>
<WinSDK-80A-NetFx35Tools-x86-InstallationFolder>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86@InstallationFolder)</WinSDK-80A-NetFx35Tools-x86-InstallationFolder>
</PropertyGroup>
<Message Importance="high" Text="MSBuildToolsPath: $(MSBuildToolsPath)" />
<Message Importance="high" Text="MSBuildToolsVersion: $(MSBuildToolsVersion)" />
<Message Importance="high" Text="WinSDK-70-NetFx35Tools-InstallationFolder: $(WinSDK-70-NetFx35Tools-InstallationFolder)" />
<Message Importance="high" Text="WinSDK-80A-NetFx35Tools-x86-InstallationFolder: $(WinSDK-80A-NetFx35Tools-x86-InstallationFolder)" />
<Message Importance="high" Text="SDK35ToolsPath: $(SDK35ToolsPath)" />
<Message Importance="high" Text="SDK40ToolsPath: $(SDK40ToolsPath)" />
<Error Condition="$(WinSDK-70-NetFx35Tools-InstallationFolder)==''" Text="WinSDK 7.0 (Windows SDK for Windows 7 and .NET Framework 3.5 SP1) is not installed, and it is required because WinSDK 8.0 or higher doesn't provide .NET 3.5 tools." />
<Error Condition="$(WinSDK-80A-NetFx35Tools-x86-InstallationFolder)==''" Text="HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86@InstallationFolder is blank. Edit it to point to $(WinSDK-70-NetFx35Tools-InstallationFolder)" />
<Error Condition="$(SDK35ToolsPath)==''" Text="SDK35ToolsPath not set. Maybe HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86@InstallationFolder is blank." />
</Target>