Develop against folder in WSL in Visual Studio 2019

Viewed 1695

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.

1 Answers

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

Related