Visual Studio 22 debug complicated WSL2 application

Ivan Ivlev 11 Reputation points
2022-07-26T14:19:00.457+00:00

Hi, I have complicated CMake project which depends on two 3rd Party directories. I saw guide here: https://devblogs.microsoft.com/cppblog/build-and-debug-c-with-wsl-2-distributions-and-visual-studio-2022/ but the way, when all project files are in Windows filesystem, but they are copied to WSL2 filesystem is not convenient for me (because it takes a lot of time and default mode copies only CMakeLists.txt folder, but not specified ones). Is there a way to use Visual Studio 22 for development of project which is already stored in WSL2 filesystem?

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,441 Reputation points Microsoft External Staff
    2022-07-27T03:26:23.603+00:00

    Hi @Ivan Ivlev ,

    Welcome to Microsoft Q&A forum.

    It is not possible. Putting files in WSL2 filesystem may be possible, but as the blog says:

    Our C++ cross-platform support in Visual Studio assumes that all source files originate in the Windows file system.

    You can’t open folders and develop your project which is already stored in WSL2 filesystem by using VS 2022, currently, I’m afraid.

    I suggest you raise a suggestion ticket on our Developer Community.

    Best Regards,
    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.
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.