Running .NET CLI applications (e.g., `dotnet run app.cs`) inside VS Code installed via snap on Ubuntu can fail with an 'An error occurred trying to start process' error. The root cause is that snap isolates each VS Code version in its own directory, and when VS Code updates, cached .NET build artifacts are copied to the new version folder but the `build-success.cache` file still references the old version's path. Since the old snap version directory is removed after an update, the binary path no longer exists. The fix is a bash script that finds and prints `rm -rf` commands to delete all stale cached build directories for a given application name under `~/snap/code/*/.local/share/dotnet/runfile/`.
370 Impressions