【问题标题】:Gulp task to web deploy from Visual Studio从 Visual Studio 进行 Web 部署的 Gulp 任务
【发布时间】:2016-07-11 11:39:32
【问题描述】:

我还没有找到关于如何通过 Gulp 任务进行发布的具体示例。有人有想法吗?

这就是我目前正在尝试的方式。

gulp.task("Deploy-To-Azure", function() {
var targets = ["Build"];
console.log("Publishing to Azure");
return gulp.src(["./src/Feature/Accounts/code"])
.pipe(foreach(function (stream, file) {
    return stream
      .pipe(debug({ title: "Building project:" }))
      .pipe(msbuild({
          targets: targets,
          configuration: "Azure",
          logCommand: false,
          verbosity: "verbose",
          stdout: true,
          errorOnFail: true,
          maxcpucount: 0,
          toolsVersion: 14.0,
          properties: {
              DeployOnBuild: "true",
              DeployDefaultTarget: "Web Deploy",
              WebPublishMethod: "FileSystem",
              DeleteExistingFiles: "false",
              _FindDependencies: "false",
              Configuration: "Release"
          }
      }))
    .pipe(debug({title: "Finished building project"}));
}));

});

但看起来项目已构建但未部署。我认为我的属性不完整。任何想法表示赞赏。谢谢你

【问题讨论】:

    标签: msbuild gulp webdeploy


    【解决方案1】:

    我尝试从命令行使用这些相同的 MSBuild 属性并收到以下错误:

    >c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild /p:DeployOnBuild=true /p:WebPub
    lishMethod=FileSystem /p:DeleteExistingFiles=false /p:DeployDefaultTarget="Web Deploy"
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.P
    ublishing.targets(4449,11): error MSB4057: The target "Web Deploy" does not exi
    st in the project. [c:\users\me\documents\visual studio 2015\projects\w
    ebapplication12\WebApplication12.csproj]
    

    除非您创建了一个名为“Web Deploy”的自定义 MSBuild 目标。这行不通。

    当我删除 /p:DeployDefaultTarget="Web Deploy" 属性时,会在 /obj/[configuration]/Package 文件夹中创建一个 WebDeploy 包。

    【讨论】:

      【解决方案2】:

      尝试 DeployDefaultTarget: "WebPublish"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-25
        • 1970-01-01
        • 2015-02-17
        相关资源
        最近更新 更多