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.
Visit the VS Code install page and select the 32 or 64 bit installer. Install Visual Studio Code on Windows (not in your WSL file system). When prompted to Select Additional Tasks during installation, be sure to check the Add to PATH option so you can easily open a folder in WSL using the code command.
From within WSL Whenever you are in a directory in WSL that you would like to access from File Explorer, simply type: $ explorer.exe . $ explorer.exe .
From VS Code Start VS Code. Press F1, select Remote-WSL: New Window for the default distro or Remote-WSL: New Window using Distro for a specific distro. Use the File menu to open your folder.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With