詹金斯的MSBuild和Web部署:无法创建Web包金斯、MSBuild、Web

2023-09-03 21:50:53 作者:薄荷味de微笑

我目前正在创建构建服务器(Windows Server R2),这却变成了要求,而无需安装Visual Studio的很多工作在詹金斯CI工作。对于这份工作,我想建立使用从我的Visual Studio项目中的.csproj文件的Web包。下面就来看看在詹金斯我的MSBuild动作设定:

I'm currently trying to create a Jenkins CI job on a build server (Windows Server R2), which has turned out to require a lot more work without installing Visual Studio. For this job, I am trying to build a Web package using the .csproj file from my Visual Studio project. Here's a look at my MSBuild action setup in Jenkins:

MSBuild Version: .NET 4.0
MSBuild Build File: MyProject\MyProj.Web\MyProj.Web.csproj
Command Line Arguments: /T:Build;Package /p:Configuration=Release;PackageLocation="C:\MyProj\MyProj.Web.zip";VisualStudioVersion=11.0

当我运行生成时发生的错误是这样的:

The error that occurs when I run the build is this:

C:\ Program Files文件(x86)的\的MSBuild \微软\ VisualStudio中\ 10.0 \网络\ Microsoft.Web.Publishing.targets(2704,5):错误:封装/发表取决于微软Web部署技术。微软Web部署未正确安装这台机器上。请从下面的链接安装:对于x86(32位): http://go.microsoft ?.COM / fwlink / LINKID = 109365.For 的x64(64位): HTTP ://go.microsoft.com/fwlink/ LINKID = 109366

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(2704,5): error : Package/Publish depends on Microsoft Web Deployment technology. Microsoft Web Deployment is not correctly installed on this machine. Please install from following link: For x86(32 bit): http://go.microsoft.com/fwlink/?LinkId=109365.For x64(64 bit): http://go.microsoft.com/fwlink/?LinkId=109366

我必须安装在构建机上的Web部署,所以我不太明白的问题可能是。任何帮助将大大AP preciated!

I do have Web Deploy installed on the build machine, so I'm not quite sure what the issue could be. Any help would be greatly appreciated!

推荐答案

我的使用情况是一样的你。 詹金斯运行的MSBuild运行msdeploy

My use case is the same as yours. Jenkins runs msbuild to run msdeploy

相反,我用msdeploy.exe

Instead of creating a package directly from msbuild, i used msdeploy.exe

所以我有一个MSBuild的目标

so i have a msbuild target

<Target Name="PackageArtifacts">
<Exec Command='"@(MsDeploy)" -verb:sync -source:iisApp="$(Source)",includeAcls=true -dest:package="$(Destination)"'/>
</Target>

在哪里 msdeploy 是目录msdeploy.exe 源是您发布的网站目录 目标是你的包名{}文件路径/package.zip

where msdeploy is the directory to msdeploy.exe source is the directory of your publishable website destination is your package name "{filepath}/package.zip"