Some time ago, I, like many of you moved to Visual Studio 2022. It works great with C# and eventually, I decided to move C++ activities to VS 2022 as well. After I installed everything, I created C++ Console Application and I try to compile it. To my surprise, it didn’t work, and got the following message:

C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\include\yvals.h(12,10): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory

After some research, I found an article that helped me. For some reason, there is an invalid path to Windows SDK in the registry. To fix this issue you need to go to this registry key:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots

And change