Share via


Windows SDK 7 in visual studio 2017

Question

Wednesday, March 15, 2017 1:12 PM

I installed Windows SDK 7 successfully but it doesn't show up in visual studio 2017 I only see 8.1 & 10.

Any hint ?

Thanks

All replies (5)

Wednesday, March 15, 2017 3:06 PM

Hi Marc,

Please look into below article:

Windows 7 SDK Setup: common installation issues and fixes

Thanks,
Sabah Shariq

[If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


Wednesday, March 15, 2017 3:17 PM

Hi,

See:

How to: Modify the Target Framework and Platform Toolset (there is a note regarding WinSDK 7 on VS 2015)
https://msdn.microsoft.com/en-us/library/ff770576.aspx

and then:

Stuck on an older toolset version? Move to Visual Studio 2017 without upgrading your toolset
https://blogs.msdn.microsoft.com/vcblog/2016/02/24/stuck-on-an-older-toolset-version-move-to-visual-studio-2015-without-upgrading-your-toolset/

My portal and blog about VSX: http://www.visualstudioextensibility.com<br/> Twitter: https://twitter.com/VSExtensibility\<br/> MZ-Tools productivity extension for Visual Studio: https://www.mztools.com


Thursday, March 16, 2017 5:35 AM

Hi Marc S._,

Welcome to the MSDN forum.

Refer to your description, please have a look at this reply that provided by Carlos. You can create a project with the default project template. After that, right click the project name under Solution Explorer and go to Configuration Properties-General, modify the 'Platform Toolset' to Windows7.1SDK, since you already installed the Windows SDK 7. Please have a look at the following note:

##To change the target platform toolset, you must have the associated version of Visual Studio or the Windows Platform SDK installed. For example, to target the Itanium platform with the Windows7.1SDK platform toolset, you must have Microsoft Windows SDK for Windows 7 and .NET Framework 4 SP1 installed

If the above not works, you can also modify the platform toolset to Visual Studio 2010 (v100), which has the same compiler like Windows SDK 7, if you have the VS 2010 and VS 2017 on the same computer, it is available like the following screenshot:

Best regards,

Sara

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Monday, July 2, 2018 8:40 PM

USELESS thanks for nothing. Doesn't even go there.


Thursday, July 5, 2018 10:00 AM

The version of the Windows SDK doesn't indicate that this is the only version of Windows the application will run on for Windows desktop applications. The last test application that I was playing with was built using the Windows 10 SDK:

but if you check things like the executable header:

C:\Users\Darran\source\repos\meh4\x64\Debug>dumpbin /headers meh4.exe
Microsoft (R) COFF/PE Dumper Version 14.14.26431.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file meh4.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
...

OPTIONAL HEADER VALUES
             20B magic # (PE32+)
           14.14 linker version
            7600 size of code
            6E00 size of initialized data
               0 size of uninitialized data
           1110E entry point (000000014001110E) @ILT+265(mainCRTStartup)
            1000 base of code
       140000000 image base (0000000140000000 to 0000000140022FFF)
            1000 section alignment
             200 file alignment
            6.00 operating system version <- 6.0 means vista
            0.00 image version
            6.00 subsystem version <- 6.0 means vista
               0 Win32 version
           23000 size of image
             400 size of headers
               0 checksum
               3 subsystem (Windows CUI)
            8160 DLL characteristics
                   High Entropy Virtual Addresses
                   Dynamic base
                   NX compatible
                   Terminal Server Aware
          100000 size of stack reserve
            1000 size of stack commit
          100000 size of heap reserve
            1000 size of heap commit
               0 loader flags
              10 number of directories
...

or the imports:

C:\Users\Darran\source\repos\meh4\x64\Debug>dumpbin /imports meh4.exe
Microsoft (R) COFF/PE Dumper Version 14.14.26431.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file meh4.exe

File Type: EXECUTABLE IMAGE

  Section contains the following imports:

    VCRUNTIME140D.dll
             14001F150 Import Address Table
             14001F518 Import Name Table
                     0 time date stamp
                     0 Index of first forwarder reference

...

    ucrtbased.dll
             14001F1E0 Import Address Table
             14001F5A8 Import Name Table
                     0 time date stamp
                     0 Index of first forwarder reference

...

    KERNEL32.dll
             14001F000 Import Address Table
             14001F3C8 Import Name Table
                     0 time date stamp
                     0 Index of first forwarder reference

                         3EB MultiByteToWideChar <- 2000
                         21C GetCurrentProcessId <- xp
                         220 GetCurrentThreadId <- xp
                         2EC GetSystemTimeAsFileTime <- 2000
                         367 InitializeSListHead <- xp
                         4CB RtlCaptureContext <- xp
                         592 TerminateProcess <- xp
                         21B GetCurrentProcess <- xp
                         2B1 GetProcAddress <- xp
                         1AF FreeLibrary <- xp
                         5D5 VirtualQuery <- xp
                         2B7 GetProcessHeap <- xp
                         34E HeapFree <- xp
                         34A HeapAlloc <- xp
                         263 GetLastError <- xp
                         605 WideCharToMultiByte <- 2000
                         449 QueryPerformanceCounter <- 2000
                         45F RaiseException <- xp
                         27A GetModuleHandleW <- xp
                         384 IsProcessorFeaturePresent <- 2000
                         2D3 GetStartupInfoW <- xp
                         573 SetUnhandledExceptionFilter <- xp
                         5B4 UnhandledExceptionFilter <- xp
                         37D IsDebuggerPresent <- xp
                         4D9 RtlVirtualUnwind <- none (xp)
                         4D2 RtlLookupFunctionEntry <- none (xp)

...

then you will find that by default, this allows you to run on Windows Vista. The Windows versions given are the documented minimum versions, not the first versions of Windows that they appeared in. For the last two, there are no documented versions, but x64 support was added to Windows with Windows XP.

So the Windows SDK doesn't do anything by default to change the version of Windows you target for a desktop application. The thing which does this is the functions that you use. If you want to guarantee that you will never you can do something like:

#include <sdkddkver.h>
#undef _WIN32_WINNT
#undef NTDDI_VERSION
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#define NTDDI_VERSION NTDDI_WIN7
//includes here

to force the Windows 10 and Windows 8.1 SDK headers to only declare functions that are available in Windows 7. This must be the first thing in a source file, if you are using precompiled headers, then this must be the first thing in the precompiled header.

As long as you don't use any functions that are not available in Windows 7, then this will work.

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.