在Visual Studio Code中发布版本

沙绍尔姆

在构建C#项目时,如何切换到VS Code中的Release配置?

现在,我使用Ctrl+F5Debug -> Start Without Debugging构建应用程序来启动我的应用程序,但这仅在创建调试版本bin/DebugBuildVS 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+BCommand Palette您可以在Build Release之间选择Build Debug

来源:https : //docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-build?tabs=netcore2x

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章