dotnet / dotnet/project-system
Add ability to suppress token substitution in launch settings strings
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
(Reported via email.)
When launching the debugger, some values in launch profiles have tokens substituted. There are two forms of this:
1. Environment variables which appear as `%MY_ENV_VAR%`.
2. MSBuild properties which appear as `$(MyProperty)`.
It's currently not possible to suppress this behaviour, if you want the value to be passed through unmodified.
---
For example, the following launch profile:
```json
{
"profiles": {
"MyProject": {
"commandName": "Project",
"commandLineArgs": "$(foo.bar)"
}
}
}
```
If you want the literal value `$(foo.bar)` to be passed verbatim to the launched executable, there is no way to achieve that today.
---
The class [`DebugTokenReplacer`](https://github.com/dotnet/project-system/blob/eb4e01a2d65fae7b0d466718356e7b9c5a175dcd/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/DebugTokenReplacer.cs) is responsible for this substitution. Any fix to this issue is likely to apply to that class.
Contributor guide
Research direction
Start with src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/DebugTokenReplacer.cs, which handles substitution for launch profile strings. Trace how %MY_ENV_VAR% and $(MyProperty) values are processed, then define a way for a launch profile value such as $(foo.bar) to be passed verbatim to the launched executable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100