更新时间:2022-12-04 18:06:55
VSCode uses dotnet CLI and particularly for building the dotnet build command. Among others, it has the following option
-o|--output <OUTPUT_DIRECTORY>
Directory in which to place the built binaries.
假设您的构建任务是在 .vscode/tasks.json
文件中定义的:
{
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet build",
...
}
]
}
您可以在所需的路径中添加 -o
arg.例如,更改为:
You may add -o
arg with the desired path. For example, change to:
...
"command": "dotnet build -o ${workspaceRoot}/bin/another_Debug/",
...
其中 $ {workspaceFolder}
是VSCode 预定义的变量:
where ${workspaceFolder}
is one of VSCode predefined variables:
$ {workspaceFolder}包含task.json文件的工作区文件夹的路径
${workspaceFolder} the path of the workspace folder that contains the tasks.json file