question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

coreclr debug configuration should support input variables for `envFile`

See original GitHub issue

VS Code has a mechanism called “input variables” where debug configuration values can be resolved by running arbitrary commands, picking an item from predefined list, or prompting the user: https://code.visualstudio.com/docs/editor/variables-reference#_input-variables

Node.js and Python debug configuration providers support this mechanism. Unfortunately, coreclr seems to lack this support.

Repro steps

  1. Create a debug configuration that uses an input variable, for example
{
    "configurations": [
        {
            "name": "Debug API",
            "type": "coreclr",
            "request": "launch",
            // other properties as necessary
            "envFile": "${input:getPathToFile}"
        }
    ],
    "inputs": [
        {
            "id": "getPathToFile",
            "type": "promptString"
             // The really interesting/important case is type==command.
             // promptString is used just to simplify the repro
         }
    ]
}
  1. Try using the configuration

Expected result

Should prompt the user for the path to the .env file

Actual result

Can't parse envFile ${input:getPathToFile} because of Error: ENOENT: no such file or directory, open '${input:getPathToFile}'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gregg-miskellycommented, Apr 26, 2022

@karolz-ms Sounds great

1reaction
connor4312commented, Mar 10, 2022

js-debug handles it at launch time, but you could also change this extension to resolve envFile after variables are substituted via the relatively-new post-substitution method in the resolver.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variables reference - Visual Studio Code
Variables Reference. Visual Studio Code supports variable substitution in Debugging and Task configuration files as well as some select settings.
Read more >
omnisharp-vscode - Discover .NET
Official C# support for Visual Studio Code (powered by OmniSharp) ... coreclr debug configuration should support input variables for envFile (#5102, ...
Read more >
Debugging profiling config settings - .NET - Microsoft Learn
This article details the settings you can use to configure .NET debugging and profiling. Note .NET 6 standardizes on the prefix DOTNET_ instead ......
Read more >
C# – Open VSX Registry
C# support for vscode-compatible editors (powered by OmniSharp and NetCoreDbg). ... coreclr debug configuration should support input variables for envFile ...
Read more >
Load environment variables from .env file into process.env for ...
config will read your .env file, parse the contents, ... You may turn on logging to help debug why certain keys or values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found