My environment is Windows 10, WSL, VSCode 1.35, and Visual Studio 2017
My general workflow is to launch vscode from wsl bash, write my code in vscode, then compile with visual studio.
The problem is that the remote development plugin for vscode locks the files and visual studio cant modify the locked files. The compiled object files cannot be overwritten because they're locked.
This sounds like an issue with some extension you are using. Maybe the C# or C++ extensions
I have the same issue. I disabled all other extensions, and it persisted. Ultimately, the problem is with the Remote WSL extension. Whenever I modify and save a remote file, VSCode seems to lock all build-related files in the directory, such that I cannot access any files from a different application (cmd in my case), until I close the workspace in VSCode. If I use VSCode without Remote WSL, I do not have this problem.
Is there a way to avoid this issue? I'm currently unable to use Remote WSL because of this.
I think it's narrow to instantly assume it's another plugin's fault. It seems to make sense that a remote development plugin would lock a file for editing which results in the issue that we're having.
@definelicht I also uninstalled Remote WSL because of this.
Maybe amend the title, since this is not Visual Studio specific. Rather, locking the files causes a conflict with any external build system.
Maybe that's related to the WSL issue that file watcher lock folders?
There's a new setting in WSL: remote.WSL.fileWatcher.polling.
Can you try if that fixes the issue?
See
https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace
remote.WSL.fileWatcher.polling has resolved https://github.com/microsoft/vscode-remote-release/issues/362 for me.
"remote.WSL.fileWatcher.polling": true,
Did not work for me, must quit VS-Code, rename in wsl-shell and restart VS-Code
Version: 1.39.1 (system setup)
Commit: 88f15d17dca836346e787762685a40bb5cce75a8
Datum: 2019-10-10T23:31:28.683Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
Betriebssystem: Windows_NT x64 10.0.18362
WSL: 0.39.9
WSL1 with Ubuntu 18.04
I periodically have to restart vscode, when using WSL remote extenstion, for my application to be able to edit/remove files. It only seems to happen sometimes and I can't figure out what is triggering it.
Closing vsode fixes it everytime.
I have used to WSL file watcher polling setting for some time. It seems to happen less frequently with this setting, but it still happens.
I have this same issue and remote.WSL.fileWatcher.polling seems to have fixed it for me!
yes, pretty sure this is related to the https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace
Closing as dup.
Most helpful comment
I have the same issue. I disabled all other extensions, and it persisted. Ultimately, the problem is with the Remote WSL extension. Whenever I modify and save a remote file, VSCode seems to lock all build-related files in the directory, such that I cannot access any files from a different application (cmd in my case), until I close the workspace in VSCode. If I use VSCode without Remote WSL, I do not have this problem.
Is there a way to avoid this issue? I'm currently unable to use Remote WSL because of this.