I'm very new to Visual Studio Code. I'm trying to debug an application that exists already that I've cloned via Git. None of my files are modified yet. I've downloaded the microsoft extension "C# for Visual Studio Code (powered by OmniSharp)". The application starts and it brings me to the home page (http://localhost:5000/). However it didn't stop at my breakpoints within startup.cs
When I look at the application while its running instead of being a red bullet point its a hollow gray breakpoint. Hovering over it tells me "The source code is different from the original version. To allow this breakpoint to be hit: Add "requireExactSource":false to launch.json and restart debugging.". I can't understand this.
I'm using:
I'm also using dotnet version 1.0.3
To disable a breakpoint without deleting it, hover over or right-click it, and select Disable breakpoint. Disabled breakpoints appear as empty dots in the left margin or the Breakpoints window. To re-enable a breakpoint, hover over or right-click it, and select Enable breakpoint.
You can delete all breakpoints in one of the following ways: On the Debug menu, click Delete All Breakpoints. On the toolbar of the Breakpoints window, click the Delete All Breakpoints button.
This happened to me when I upgraded my project from .NET Core 2.0 to 2.1. The problem was that I forgot to edit launch.json
to change the binary path from netcoreapp2.0
to netcoreapp2.1
so VS Code was looking for binaries in the wrong place. Editing the path fixed the problem.
EDIT: I suggest VS Code team to adopt a variable-based approach to fix this issue completely, like having something like $TargetRuntime
in the path instead of something hardcoded like netcoreapp2.1
etc.
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