dotnet / dotnet/vscode-csharp

VCS Debugger Breakpoints' paths are changed to the wrong value

Open
#5,381 4 comments 0 reactions 0 assignees View on GitHub
Debugger OmniSharp Question
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

Im attempting to connect my debugger to a dotnet3.1 service running inside an alpine container, im attempting to use these docs https://github.com/OmniSharp/omnisharp-vscode/wiki/Attaching-to-remote-processes#installing-vsdbg-on-the-server

## Environment data
`dotnet --info` output:
VS Code version: 1.71.1
C# Extension version: 0.7.7

The dll's for my application are stored in `/app` inside the docker image. My service is published in the Dockerfile using Debug configuration with portable

my launch.json task
```json
{
"name": ".NET Core Docker Attach",
"type": "coreclr",
"request": "attach",
"processId": "1",
"pipeTransport": {
"pipeProgram": "docker",
"pipeArgs": [ "exec", "-i", "2862e1254f00" ],
"debuggerPath": "/root/vsdbg/vsdbg",
"pipeCwd": "${workspaceFolder}/src/DB.API",
"quoteArgs": false
},
"logging": {
"moduleLoad": false,
"engineLogging": true,
"trace": true
},
"sourceFileMap": {
"/app": "${workspaceFolder}/src/DB.API" //the csproj file of my api is here
},
}
```

## OmniSharp log
```
-> (C) {"command":"setBreakpoints","arguments":{"source":{"name":"HealthCheckController.cs","path":"/Users/isaac.patterson/dev/dbx/document-branding-service/src/DB.API/Controllers/HealthCheckController.cs","checksums":[{"algorithm":"SHA1","checksum":"fcc6f4f0342c29bf4e22856510c2018cccd51a34"},{"algorithm":"SHA256","checksum":"55eb2d1c3a09808508a447561c3529d082c76a3695be60a3f978bd72dc3d0bdc"},{"algorithm":"SHA1","checksum":"b51b4e9c6015bc25cd7a2ee70185c5eebe4abf6f"},{"algorithm":"SHA256","checksum":"2fee18185ea8c7e7ba35c61b7781ef18c556f930781bfc68307e5f50ffb1a922"}]},"lines":[48],"breakpoints":[{"line":48}],"sourceModified":false},"type":"request","seq":9}

<- (R) {"seq":263,"type":"response","request_seq":9,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"source":{"name":"HealthCheckController.cs","path":"/src/Controllers/HealthCheckController.cs","sourceReference":0,"checksums":[{"algorithm":"SHA256","checksum":"55eb2d1c3a09808508a447561c3529d082c76a3695be60a3f978bd72dc3d0bdc"}]},"line":48,"endLine":48,"offset":0}]}}
```

## Expected behavior
`/Users/isaac.patterson/dev/dbx/document-branding-service/src/DB.API/Controllers/HealthCheckController.cs`should map to `/src/DB.API/Controllers/HealthCheckController.cs` but `DB.API/` is missing

## Actual behavior
Maps to `/src/Controllers/HealthCheckController.cs` which is not a file
![image](https://user-images.githubusercontent.com/84692374/191665300-bc9d59bf-7c99-46ca-b0f9-c793c7f57d41.png)

When I hit the endpoint with the breakpoint, the request does not go all the way through as if the breakpoint is working - however on my vcs nothing shows

## Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.