15

I've tried to find any information on this, but failed.

Is it possible to use Visual Studio 2019 to develop against a folder on WSL?

I know that it's possible with VS Code and the remote WSL extension, but I really prefer working in Visual Studio.

I also prefer having the code in a folder in WSL since I do a lot of work in the terminal and I've experienced a lot of file locks and other problems when having the code in a folder on the Windows host.

Joel
  • 8,502
  • 11
  • 66
  • 115
  • 1
    I've been having a lot of difficulty with this on WSL2. [Visual Studio can't open project files under wsl$](https://developercommunity.visualstudio.com/t/unable-to-open-projects-in-wsl-2-filesystem/1292260) while [WSL doesn't seem to get file change notifications for changes made on the Windows filesystem](https://github.com/microsoft/WSL/issues/4739) (amongst other problems). VS Code gets around the problem by opening the project inside WSL via the Remote WSL Extension, but there doesn't seem to be any useful equivalent for Visual Studio 2019. I'd be delighted if there was a solution. – Iain Galloway Mar 01 '21 at 11:53

1 Answers1

1

In Visual Studio 2019 there is no such equivalent to the remote WSL extension, therefore, it is (still) not possible to open a folder from WSL or WSL2.

However, it is possible to work on a Windows local folder and compile, debug and execute in WSL2. You can follow this tutorial to set it up (also possible with WSL2 without SSH, just tried it and works perfectly). Moreover in the WSL terminal you can navigate to Windows directories mounted in /mnt/[your_disk_name] and execute linux terminal commands.

EDIT: In VS 2022 is now possible. See this

MH_
  • 11
  • 1
  • 3
  • Regarding your edit, is there a way to create makefile projects too (no CMake projects)? – godo Mar 01 '22 at 07:46
  • 1
    I'm afraid it's not possible, I tried it because I also have a project with makefiles (no CMake) but I could not come up with a solution. From all the docs I've seen, they only talk about CMake projects. – MH_ Mar 02 '22 at 14:04
  • Agreed. This seems like a pity to me, being forced to use CMake. I am trying to set up a CMake project as we speak on VS 2022. – godo Mar 02 '22 at 14:59