在构建C#项目时,如何切换到VS Code中的Release配置?
现在,我使用Ctrl+F5
或Debug -> Start Without Debugging
构建应用程序来启动我的应用程序,但这仅在创建调试版本bin/Debug
。Build
VS Code中没有菜单。
这是我的tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/dotnetcore-test.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
像这样编辑task.json:
{
"version": "2.0.0",
"tasks": [
{
"taskName": "build Debug",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/dotnetcore-test.csproj"
],
"problemMatcher": "$msCompile"
},
{
"taskName": "build Release",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/dotnetcore-test.csproj",
"-c",
"Release"
],
"problemMatcher": "$msCompile"
}
]
}
然后当您按下时Ctrl+Shift+B
,Command Palette
您可以在Build Release
和之间选择Build Debug
来源:https : //docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-build?tabs=netcore2x
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句