Hello @Zhu, Bryan,
I firstly checked on my machine, which has both VS 2022 and VS 2017 installed. On VS 2017, Windows SDK 10.0.17763.0 was installed(I think, it was installed along with the C++ workload). On VS 2022, higher version of Windows SDK 10.0.22621.0 was installed. I didn’t install Windows SDK 10.0.17763.0 separately neither v141 C++ toolset(on VS 2022).
I then create a C++ project in VS 2017, set the Windows SDK and build it. Open it in VS 2022, I see that Windows SDK 10.0.17763.0 lists there and I can retarget it successfully.
After that I test on another machine, with only VS 2022 and C++ workload installed. I get the same error as yours. I do below method 1 and it works:
So, I think you may check following three methods to make it work on your side:
- Open Control Panel, right-click Windows 10.0.17763, select Change. Make sure that "Windows SDK for Desktop C++ amd64 Apps" and "Windows SDK for Desktop C++ x86 Apps" has been checked, click Change to install it. Restart VS and reopen your project, retarget the project, or change the properties(Windows SDK) in its property page.
- Reinstall/Repair Windows SDK(10.0.17763.0).
- Reinstall the C++ workloads in VS, from VS Installer, Modify. Try to reinstall VS 2022 if possible.
- As the last resort, if it still doesn't work after you try many methods, then consider installing VS 2017 and install C++ workload along with Windows SDK 10.0.17763.0.
BTW, is there any limitation on your machine, like group policy, antivirus, and permission limitation? If so, maybe something blocks VS from detecting the installed Windows SDK 10.0.17763.0.
Feel free to let us know the results.
Sincerely,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.