Jenkins, MSBuild and Web Deploy: Unable to create

2019-04-02 05:24发布

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\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

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!

3条回答
小情绪 Triste *
2楼-- · 2019-04-02 05:49

Try installing WebDeploy from your Visual Studio installation (e.g C:\software\VS\SW_DVD9_Visual_Studio_Pro_2010_English_Core_MLF_X16-76715\WCU\MSDeploy) on the build server.

Installing it via Web Platform Installer AND via download from http://www.iis.net/downloads/microsoft/web-deploy didn't work for me.

查看更多
太酷不给撩
3楼-- · 2019-04-02 06:01

I uninstalled all versions of Web Deploy and Web Deployment Tool, then installed Web Deploy 3.5 using Web Platform installer. It fixed the issue.

查看更多
相关推荐>>
4楼-- · 2019-04-02 06:11

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

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

so i have a msbuild target

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

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

查看更多
登录 后发表回答