Share via


MSB8036: The Windows SDK version 10.0.17763.0 was not found (Visual Studio 2017 Enterprise)

Question

Thursday, February 21, 2019 9:41 PM

Trying to run a service project that references a C++ DLL project.  I am able to build and debug it within the IDE but I cannot seem to be able to build and execute using "dotnet run"

"dotnet run" attempts to build the project first and initially I had to deal with it trying to reference C:\Microsoft.Cpp.Default.props which I was able to resolve by adding the environment variable "VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets"

Now I am stuck where MSBuild is looking for the defined Windows SDK (v 10.0.17763.0).

I attempted a repair on VS 2017 which did not fix the problem.

I then checked to make sure that Windows 10 SDK was included as an option under "Desktop development with C++" as per previous discussions.

Neither change is fixing my issue.

It appears that the SDk is in installed under C:\Program Files (x86)\Windows Kits\10\..

Thanks for any and all help!

All replies (3)

Thursday, February 21, 2019 11:41 PM

Are you running this from a command prompt where you have run the vcvars batch file? I ask this because the batch file sets all of the environment variables identifying where the Windows SDK is.

So if you haven't already, after you opened the command prompt window that you use to run dotnet, go to %ProgramFiles(x86)%\Microsoft Visual Studio\2017\Edition>\Common7\Tools, find vsdevcmd.bat and run this. You could also go straight for the vcvarsall.bat file too.

You can use the -? option to get information on how to choose the platform that the command prompt will target and if needed, how to specify which Windows 10 SDK to use.

This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.


Friday, February 22, 2019 7:26 PM

Yes I am trying to execute from a command prompt but I was not executing either batch to properly set the environment :( However, I am now running vsdevcmd.bat which appears to be creating the correct environment but getting the same error message:

C:\Users\10056325\source\repos\Synapsys\Services\BD Expert\BD Expert Service\BDExpertService>dotnet run
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\10056325\source\repos\Synapsys\Services\BD Expert\CLIPS CLR Wrapper\CLIPSCLRWrapper\CLIPSCLRWrapper.vcxproj]

The environment looks like this:

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\10056325\AppData\Roaming
CommandPromptType=Native
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=AMD031LXJ8BRHM2
ComSpec=C:\WINDOWS\system32\cmd.exe
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
Framework40Version=v4.0
FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework\
FrameworkDIR32=C:\WINDOWS\Microsoft.NET\Framework\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
FSHARPINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\
HOMEDRIVE=p:
HOMEPATH=\
HOMESHARE=\Bdx.com\Users\MD031\Users1\Global_1005\10056325
HOSTNAME=AMD031LXJ8BRHM2
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;
LOCALAPPDATA=C:\Users\10056325\AppData\Local
LOGONSERVER=\NAMD00DC03
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\
NUMBER_OF_PROCESSORS=8
OneDrive=C:\Users\10056325\OneDrive
OS=Windows_NT
Path=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\dotnet\C:\Program Files\Microsoft SQL Server\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\C:\Program Files (x86)\dotnet\C:\Program Files\nodejs\C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\C:\Program Files\Microsoft SQL Server\130\DTS\Binn\C:\WINDOWS\System32\OpenSSH\C:\Program Files\Intel\WiFi\bin\C:\Program Files\Common Files\Intel\WirelessCommon\C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin;C:\Program Files\PuTTY\C:\Program Files\Git\cmd;C:\Program Files\1E\NomadBranch\C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\C:\bin;C:\Users\10056325\AppData\Local\Microsoft\WindowsApps;C:\Users\10056325\AppData\Roaming\npm;C:\Users\10056325\AppData\Local\GitHubDesktop\bin;C:\Users\10056325\dotnet\tools;C:\Users\10056325\AppData\Local\Programs\Fiddler;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PLMVIS_82_LIBPATH=C:\Program Files (x86)\SAP\FrontEnd\SAPgui\Program
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=5e03
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\
PUBLIC=C:\Users\Public
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\Users\10056325\AppData\Local\Temp
TMP=C:\Users\10056325\AppData\Local\Temp
UATDATA=C:\WINDOWS\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
UCRTVersion=10.0.17763.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
USERDNSDOMAIN=BDX.COM
USERDOMAIN=BDX
USERDOMAIN_ROAMINGPROFILE=BDX
USERNAME=10056325
USERPROFILE=C:\Users\10056325
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\
VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Redist\MSVC\14.16.27012\
VCToolsVersion=14.16.27023
VisualStudioVersion=15.0
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_VER=15.9.7
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
VSSDK150INSTALL=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VSSDK
windir=C:\WINDOWS
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.17763.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\
WindowsSDKVersion=10.0.17763.0\
WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\
WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
WIX=C:\Program Files (x86)\WiX Toolset v3.11\
__DOTNET_ADD_32BIT=1
__DOTNET_PREFERRED_BITNESS=32
__VSCMD_PREINIT_PATH=C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\dotnet\C:\Program Files\Microsoft SQL Server\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\C:\Program Files (x86)\dotnet\C:\Program Files\nodejs\C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\C:\Program Files\Microsoft SQL Server\130\DTS\Binn\C:\WINDOWS\System32\OpenSSH\C:\Program Files\Intel\WiFi\bin\C:\Program Files\Common Files\Intel\WirelessCommon\C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin;C:\Program Files\PuTTY\C:\Program Files\Git\cmd;C:\Program Files\1E\NomadBranch\C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\C:\bin;C:\Users\10056325\AppData\Local\Microsoft\WindowsApps;C:\Users\10056325\AppData\Roaming\npm;C:\Users\10056325\AppData\Local\GitHubDesktop\bin;C:\Users\10056325\dotnet\tools;C:\Users\10056325\AppData\Local\Programs\Fiddler

Update:  I copied the project to another solution on another computer and the property pages came back.


Monday, February 25, 2019 2:34 PM

I was looking more into this and I'm wondering if this is due to the dotnet command line not being able to properly understand Visual C++.

One thing that I would ask you to try out is try building your project using the MSBuild that is in the Visual Studio 2017 directory instead of using the dotnet command.

The documentation for dotnet states that it builds using MSBuild, but if you use just any version of MSBuild then it will not work. For example, using the version from the .NET framework directory:

C:\Users\archa\source\repos\meh>c:\windows\Microsoft.NET\Framework64\v4.0.30319\msbuild
Microsoft (R) Build Engine version 4.7.3190.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 25/02/2019 14:30:46.
Project "C:\Users\archa\source\repos\meh\meh.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|x64".
Project "C:\Users\archa\source\repos\meh\meh.sln" (1) is building "C:\Users\archa\source\repos\meh\meh\meh.vcxproj" (2)
 on node 1 (default targets).
C:\Users\archa\source\repos\meh\meh\meh.vcxproj(28,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.pr
ops" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\archa\source\repos\meh\meh\meh.vcxproj" (default targets) -- FAILED.

Done Building Project "C:\Users\archa\source\repos\meh\meh.sln" (default targets) -- FAILED.

Build FAILED.

"C:\Users\archa\source\repos\meh\meh.sln" (default target) (1) ->
"C:\Users\archa\source\repos\meh\meh\meh.vcxproj" (default target) (2) ->
  C:\Users\archa\source\repos\meh\meh\meh.vcxproj(28,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.
props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.55

but using the version from the Visual Studio directory:

C:\Users\archa\source\repos\meh>msbuild
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 25/02/2019 14:32:48.
Project "C:\Users\archa\source\repos\meh\meh.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|x64".
Project "C:\Users\archa\source\repos\meh\meh.sln" (1) is building "C:\Users\archa\source\repos\meh\meh\meh.vcxproj" (2)
 on node 1 (default targets).
InitializeBuildStatus:
  Creating "x64\Debug\meh.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  All outputs are up-to-date.
Link:
  All outputs are up-to-date.
  meh.vcxproj -> C:\Users\archa\source\repos\meh\x64\Debug\meh.exe
FinalizeBuildStatus:
  Deleting file "x64\Debug\meh.tlog\unsuccessfulbuild".
  Touching "x64\Debug\meh.tlog\meh.lastbuildstate".
Done Building Project "C:\Users\archa\source\repos\meh\meh\meh.vcxproj" (default targets).

Done Building Project "C:\Users\archa\source\repos\meh\meh.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.30

So you may just have to change your ordering to build with the Visual Studio MSBuild before you run it using dotnet.

This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.