vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

justMyCode does not seem to work

Open WardenGnaw opened this issue 4 months ago • 0 comments

Originally from: https://github.com/microsoft/vscode-dotnettools/issues/2107 By: @AntoineC4Ci

Describe the Issue

Context

We're developing in C# using DevKit in VSCode, using devcontainer. The workspaceName.code-worskpace configuration explicitly includes "justMyCode": true:

"launch": {
    "version": "0.2.0",
    "configurations": [
      {
        "name": "SERVER",
        "type": "coreclr",
        "request": "launch",
        "justMyCode": true,
        "preLaunchTask": "build-server",
        "program": "${workspaceFolder:ROOT}/server/apps/xyz/bin/Debug/net9.0/workspacename", 
        "launchSettingsFilePath": "${workspaceFolder:ROOT}/server/apps/solution.ds/Properties/launchSettings.json", 
        "launchSettingsProfile": "http",
        "internalConsoleOptions": "neverOpen",
        "cwd": "${workspaceFolder:ROOT}/server/apps/xyz/xyz" 
      }     
    ]
  },

the ${workspaceFolder:ROOT}/server/apps/solution.ds/Properties/launchSettings.json file looks like:


{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "http": {
      "commandName": "Project",
      "applicationUrl": "http://localhost:4210",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

We expect the debugger to stop only within our own code, and skip stepping into or stopping in Microsoft/.NET library code (e.g., LINQ internals, System.* classes).

Issues Observed

Exceptions break inside .NET library code, not in user code:

For example, a System.InvalidOperationException thrown by a LINQ query (like .First()) breaks inside Microsoft’s implementation instead of at the line in user code that triggered it.

F10 (Step Over) still enters Microsoft methods:

Even when stepping over methods like LINQ or other framework calls, the debugger steps into .NET assemblies instead of skipping them.

These behaviors indicate that "justMyCode": true is not functioning as intended.

Any idea ?

Thanks

Expected Behavior

I expect the debugger to work like in VS : just in my code.

Environment Information

VSCode: Version: 1.101.1 (system setup) Commit: 18e3a1ec544e6907be1e944a94c496e302073435 Date: 2025-06-18T13:35:12.605Z Electron: 35.5.1 ElectronBuildId: 11727614 Chromium: 134.0.6998.205 Node.js: 22.15.1 V8: 13.4.114.21-electron.0 OS: Windows_NT x64 10.0.26100

DevKit: Identifier ms-dotnettools.csdevkit Version 1.20.35

DotNet 9.0

Windows 11

WardenGnaw avatar Jun 27 '25 17:06 WardenGnaw