Msbuild 从VisualStudio将任务打包到web部署

Msbuild 从VisualStudio将任务打包到web部署,msbuild,gulp,webdeploy,Msbuild,Gulp,Webdeploy,我还没有找到一个具体的例子来说明如何通过“吞咽”任务进行发布。有人有主意吗 这就是我目前正在努力的方向 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) { re

我还没有找到一个具体的例子来说明如何通过“吞咽”任务进行发布。有人有主意吗

这就是我目前正在努力的方向

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属性,但收到以下错误:

>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部署”的自定义MSBuild目标。这行不通


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

我试图从命令行使用这些相同的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部署”的自定义MSBuild目标。这行不通

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

尝试DeployDefaultTarget:“WebPublish”

尝试DeployDefaultTarget:“WebPublish”