Kinda new to Visual Studio Code and Angular applications with a C# Web API back-end. No problem hitting a breakpoint in C#, just not hitting it in Angular app in VS Code!
I can run both apps just fine the in the browser, from the terminal, with dotnet run
and ng serve
BUT when I hit the debug button to debug my app, Angular breakpoints go from red to hollow grey!
Disclaimer - I have to mention that I changed lots of the file names and renamed the .csproj file because I wanted the app to reflect my name and not the one the instructor used. Before I did this, I was able to set breakpoints and hit them in the Angular app.
Here is what I've tried.
- restarted VS Code
- ng start, ng serve
- generated a new launch.json file (auto-generated by VS Code) in the same folder level that contains my two project folders (Ng, .Net)
- removed my workspace file (can't seem to generate a new one, not sure if I need to)
In the file:
error.interceptor.ts
I'm trying to test this exception handling by saying:
throw new Exception("Some login error");
in my Login method.
I can set a breakpoint shown below but it becomes a grey circle and never gets hit when I click Debug.
Here is where I set the breakpoints
Here is what I see when running the debugger, the red circles become grey and hollow. I'd like to be able to step through this error interceptor when debugging, is this possible?
and then in my login method from my angular app, my breakpoints become grey
Here is my launch.json file
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Yogabandy.API/bin/Debug/netcoreapp2.2/Yogabandy.API.dll",
"args": [],
"cwd": "${workspaceFolder}/Yogabandy.API",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
Also - I'm seeing a lot of these lines when I run the debug console. Don't know if this is normal?
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.2.4/System.Threading.dll'. The module was built without symbols. Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.2.4/System.IO.FileSystem.Watcher.dll'. Skipped loading symbols. The module is optimized and the debugger option 'Just My Code' is enabled.