VS Code debug unable to open file

Jarryd Rogers 1 Reputation point
2022-04-04T23:02:12.737+00:00

Hello,

I am running into an issue in the VS Code (v1.66.0) debugger where I set an inline breakpoint, run the debugger, then VS Code is unable to open the file containing the breakpoint.

The breakpoint is being set by navigating to the file within the Explorer tab and clicking on the line such that a red dot appears.
In the Run and Debug tab, the Breakpoints list displays the breakpoint's correct relative directory.
For this example, it shows: lz2\lz2_cli\src\cli

However, when the debugger commences, the Breakpoints list seems to change the directory of the breakpoint's location to include a root/workspace directory that is incorrect.
For this example, it shows: C:\Data\Software\lz2\lz2_cli\src\cli
When it should be: C:\Data\Software_Work\lz2\lz2_cli\src\cli

Therefore, VS Code is unable to open the file during debugging as the location is wrong.

I dare say this would have something to do with me changing the folder name in File Explorer while VS Code was open.
Also, possibly has something to do with the Git repository being called Software
In the meantime, I have tried deleting the entire AppData/Roaming/Code folder to remove all caches I could find and re-installed VS Code to no avail.

Thanks in advance.

Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
773 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnnaXiu-MSFT 15,001 Reputation points
    2022-04-05T07:19:38.24+00:00

    Hi @Jarryd Rogers ,

    Visual Studio Code and Visual Studio are two different products. The tag “vs-debugging” is related to Visual Studio, for more questions about Visual Studio Code, we suggest you post it to the GitHub-vscode forum or visual-studio-code in stackoverflow where you would get professional support for this product. Thanks for your understanding.

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments