VS Code调试C#应用时传递环境变量失败的问题排查
在VS Code中调试C#应用时传递环境变量遇到的问题
我在Visual Studio Code中调试C#应用时,尝试传递环境变量。根据官方文档说明,需在launch.json中使用"env"字段,但VS Code的智能感知标记该字段无效,应用无法读取声明的环境变量。使用"environmentVariables"字段也得到相同结果,而使用"environment"字段时,构建会出现“Error processing launch options at field:”错误。


以下是我的launch.json配置:
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "C#: <project name snipped> Debug", "type": "dotnet", "request": "launch", "projectPath": "${workspaceFolder}/<project name snipped>.csproj", "env": { "DATA_ROOT": "./data" } } ] }
内容的提问来源于stack exchange,提问作者MiffTheFox
相关产品推荐
相关产品推荐

