diff --git a/src/configurationProvider.ts b/src/configurationProvider.ts index e4eaceb04..6cb08e41c 100644 --- a/src/configurationProvider.ts +++ b/src/configurationProvider.ts @@ -146,7 +146,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro /** * Try to add all missing attributes to the debug configuration being launched. */ - resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult { + resolveDebugConfigurationWithSubstitutedVariables(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult { if (!config.type) { // If the config doesn't look functional force VSCode to open a configuration file https://github.com/Microsoft/vscode/issues/54213 @@ -155,7 +155,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro if (config.request === "launch") { if (!config.cwd && !config.pipeTransport) { - config.cwd = "${workspaceFolder}"; + config.cwd = folder?.uri?.fsPath; // Workspace folder } if (!config.internalConsoleOptions) { config.internalConsoleOptions = "openOnSessionStart"; @@ -163,7 +163,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro // read from envFile and set config.env if (config.envFile) { - config = this.parseEnvFile(config.envFile.replace(/\${workspaceFolder}/g, folder.uri.fsPath), config); + config = this.parseEnvFile(config.envFile, config); } }