dotnet / dotnet/vscode-csharp

picking active project seems to have no effect

Open
#205 16 comments 0 reactions 0 assignees View on GitHub
Debugger Feature Request OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

In the bottom right, there is an option to click on `[C#]` and a menu slides down to list all the projects in your solution with a `project.json` file. I obviously pick the one I expect I want to debug.

However this doesn't seem relevant. It doesn't seem to have any impact on the behavior of the intellisense, tool tips, or debugger.

For instance, I have this structure;

```
/
/solution-name
/src
/project-1
/project-2
/project-3
/project-4
/project-5
```

`project-5` is my executable; the others are libraries. so I obviously pick `project-5`. However when I go to configure `launch.json`...

```
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug//",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
},
```

Okay, for starters - I picked `project-5`, so I would expect that to be my `${workspaceRoot}` - but it still treats the top level directory as the root.

Next, what's the purpose of having `cwd` if `${workspaceRoot}` already exists? I tried changing it to something else and replacing the workspaceRoot variable in the `program` path - but it did nothing.

Then, `` doesn't work, either. Some of us have executable. Could this be changed to just `` so we can write the extension appropriate for our environment?

We could really use some more variables to make this work;

`${activeProject}` - the path to the `project.json` you picked.
`${activeRuntime}` - this ought to relate to a runtime variable if we're using it. It could go beneath `cwd` easily.
`${projectName}` - as it sounds - the name of the folder containing the `project.json` you picked.

This would help greatly in making the debugging experience a lot more extensible. As it is now, I have hard-code the path from `${workspaceRoot}` every time.

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.