ctaggart / SourceLink

Source Code On Demand
MIT License
356 stars 55 forks source link

Question : Why does SourceLink test pass but debug doesn't work? #394

Closed mjebrahimi closed 4 years ago

mjebrahimi commented 4 years ago

Package RamDisk pass SourceLink test but Debug doesn't work! (in both VS and VSCode)

SourceLink test output:

> sourcelink test RamDisk.1.0.4.nupkg

sourcelink test passed: lib/net40/RamDisk.pdb
sourcelink test passed: lib/net45/RamDisk.pdb
sourcelink test passed: lib/net461/RamDisk.pdb
sourcelink test passed: lib/netstandard2.0/RamDisk.pdb

My Visual Studio options set as below (plus "Suppress JIT optimization" is checked) alt text And my VSCode launch.json as below

{
   "version": "0.2.0",
   "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/New folder.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,

            "internalConsoleOptions": "openOnSessionStart",
            "justMyCode": false,
            "suppressJITOptimizations": true
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

VSCode debug console output:

Loaded 'C:\...\bin\Debug\netcoreapp3.1\RamDisk.dll'. Cannot find or open the PDB file.
mjebrahimi commented 4 years ago

I found that SourceLink debugging just work with <DebugType>embedded</DebugType>

ctaggart commented 4 years ago

@mjebrahimi, that isn't source linking, that is embedded pdb. If that works for you, that is wonderful. I no longer have any time to contribute to SourceLink. If I do, it will be over in the https://github.com/dotnet/sourcelink repository.