Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
It seems that Visual Studio has issues with files that are stored under WSL 2. Whilst it can access the files and edit them and compile project correctly, it seems unable to use them for IntelliSense and cannot re-open the views on them when restarting. In this case the code is C++, but the editor is common.

Microsoft have proven incapable of finding a solution so I wondered if anybody else has experienced this and possibly found a solution.

I've also had problems adding files to Python projects. It is unable to add files if they are in WSL, but if I add the paths to the XML project file manually it can edit and debug the project correctly.

What I have tried:

Tried creating hard links to the WSL share in file explorer and mapping the WSL folders as a network drive. VS just seems to have problems when the folder is under WSL, but it can access the files to edit and compile them.
Posted
Updated 21-Feb-23 20:53pm
v2
Comments
Richard MacCutchan 7-Feb-22 9:49am    
Do you really mean Visual Studio, or Visual Studio Code? I have used VS Code with WSL and never had a problem.

1 solution

The problem is that vs tries to create a directory/file .vs/slnx.sqlite and lock it, but file locking is not implemented through wsl shares. I would try samba shares, they should support locking.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900