如何在VSCode中设置默认发布操作

时间:2018-02-05 01:06:37

标签: c# visual-studio-code .net-core asp.net-core-mvc

从VSCode发布我的asp应用程序时,我正在使用命令

dotnet publish -c release -o Z:\inetpub\wwwroot\Tools

有没有办法让它成为默认的发布命令,所以我不需要每次都在终端输入它?

1 个答案:

答案 0 :(得分:1)

You could set this up as a VS Code task

Something like this:

{
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "publish",
            "type": "shell",
            "command": "dotnet publish",
            "args": [
                "-c", "release",
                "-o", "Z:\inetpub\wwwroot\Tools"
            ],
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        },
    ]
}