Hello,
I am attempting to setup a cross-platform environment with Visual Studio 2022, using WSL Ubuntu-24.04, and WSL-GCC-Debug configuration.
VS2022 intellisense is erroring with E1696, "cannot open source file" for the headers in my WSL distro.


Similar questions suggest to run Project -> Rescan Solution. So, I ran it, and the logs below indicate that the includes are downloaded from the WSL distro into my Windows.
liblinux.Local.Shell.WindowsSubsystemShell: Read async: 46903da0-8c99-4008-8256-a9a9188696d6
liblinux.Shell.AsyncCommandBase: Command "rm -rf $HOME/.vs/rsync/16688_0ae58fd9-be41-475f-bc0e-e19771ad3b59/" finished with exit code 0 after 1.55ms
liblinux.IO.Rsync: Transfer of source='/usr/lib/gcc/x86_64-linux-gnu/14/include, /usr/local/include, /usr/include/x86_64-linux-gnu, /usr/include, /usr/include/c++/14, /usr/include/x86_64-linux-gnu/c++/14, /usr/include/c++/14/backward' dest='C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\lib\gcc\x86_64-linux-gnu\14\include, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\local\include, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\x86_64-linux-gnu, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\c++\14, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\x86_64-linux-gnu\c++\14, C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\c++\14\backward' lasted for: 4633ms
liblinux.Services.RsyncRemoteCompilerIOImpl: Copying headers lasted 4640ms
Microsoft.VisualStudio.Linux.LinuxHeadersUpdateTaskBare: CreateVisualStudioNotificationsTask updateHeaders.LogMessage(e.Message)=Done syncing header files.
liblinux.Services.HeaderCacheManager: Updated headers: C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\lib\gcc\x86_64-linux-gnu\14\include;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\local\include;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\x86_64-linux-gnu;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\c++\14;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\x86_64-linux-gnu\c++\14;C:\Users\Joel\AppData\Local\Microsoft\Linux\HeaderCache\1.0\Ubuntu-24.04\usr\include\c++\14\backward
Microsoft.VisualStudio.Linux.LinuxHeadersUpdateTaskBare: CreateVisualStudioNotificationsTask updateHeaders.LogMessage(e.Message)=Local copy of remote sysroot done.
Microsoft.VisualStudio.Linux.LinuxHeadersUpdateTaskBare: CreateVisualStudioNotificationsTask updateHeaders.LogMessage(e.Message)=Writing information cache to disk.
Microsoft.VisualStudio.Linux.LinuxHeadersUpdateTaskBare: CreateVisualStudioNotificationsTask CreateLocalSysroot - done
Microsoft.VisualStudio.Linux.LinuxHeadersUpdateTaskBare: UpdateHeadersFinished Finished updating headers from 'Ubuntu-24.04'.
I navigated to the folders and do indeed see the WSL header files for the standard library. The image below shows the standard library header files pulled from the WSL distro Ubuntu 24.04.

VS2022 must have a configuration for the HeaderCacheManager where it stores these folder paths. Something is affecting it to not allow intellisense to find the headers. I do have both gcc/g++ versions 13 and 14 installed, perhaps VS2022 cannot distinguish between the two?
Any help would be appreciated.
Thanks,
Joel