MSBuild error MSB8036
The Windows SDK 'version' was not found
This error occurs when Visual Studio or MSBuild can't find the Windows SDK requested by your project in the expected location.
If you're building your project in Visual Studio, the first thing to check is that the project targets the correct version of the Windows SDK. Right-click on the project node, and choose Properties or press Alt+Enter. The Property Pages dialog for your project appears. Under Configuration Properties > General, look for Windows SDK Version. For example, it might be 10 (latest installed version), which selects the most recent version if more than one version is installed. If you select the dropdown, you can see specific versions that Visual Studio has detected. Make sure that the version your project needs is selected.
If you're using MSBuild directly, not with Visual Studio, you should check the places where the WindowsTargetPlatformVersion
property might be set. It's usually in the project file, but it could also be in an imported file or in a global settings file such as Directory.build.props. This file can be located anywhere in the parent path to your project, up to the root of the drive. The default setting in a newly created project file looks like this:
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
Also, check build scripts or CI jobs that invoke MSBuild. Make sure the command line isn't passing an invalid value for this property.
If that doesn't resolve the issue, install or reinstall the Windows SDK version your project needs. You can install specific versions of the Windows SDK by using the Visual Studio Installer. Select the version in Individual Components. You can also download the Windows SDK from the Windows Dev Center.