Web Deploy 3.0在CI服务器上不起作用 [英] Web Deploy 3.0 won't work on CI server

查看:134
本文介绍了Web Deploy 3.0在CI服务器上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的本地计算机到开发服务器,使用以下命令,Web Deploy 3.0可以与Visual Studio 2012发布配置文件一起很好地工作:

From my local machine to a development server, Web Deploy 3.0 works fine with Visual Studio 2012 publish profiles using the following command:

msbuild.\ myproj.csproj/verbosity:d/p:DeployOnBuild=true;PublishProfile=Develop;VisualStudioVersion=11.0;AllowUntrustedCertificate=true;用户名= xx;密码= xx

msbuild .\myproj.csproj /verbosity:d /p:DeployOnBuild=true;PublishProfile=Develop;VisualStudioVersion=11.0;AllowUntrustedCertificate=true;username=xx;password=xx

从CI服务器运行同一命令(可能是Jenkins,但这应该适用于任何命令)时,该命令成功完成,但从未部署任何网站.

When running this same command from the CI server (happens to be Jenkins but this should apply to any), the command finishes successfully, but no web site is ever deployed.

比较日志输出时,构建服务器似乎跳过了很大一部分.它仅在下面列出的2行之后发生(在本地或CI服务器上运行时,这2条输出是相同的):

When comparing the log output, a large section appears to be skipped by the build server. It is occuring just after the 2 lines listed below (these 2 lines of output are identical when running local or on the CI server):

文件中的目标"PrepareForRun" 项目中的"C:\ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets" "C:_Application \ proj \ src \ proj.Web \ proj.Web.csproj"(目标 "CoreBuild"取决于它): 在项目"proj.Web.csproj"中完成了构建目标"PrepareForRun".

Target "PrepareForRun" in file "C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" from project "C:_Application\proj\src\proj.Web\proj.Web.csproj" (target "CoreBuild" depends on it): Done building target "PrepareForRun" in project "proj.Web.csproj".

在本地运行时,其后跟下面显示的内容(加上数百行日志记录):

When running locally, this is followed up by what is shown below (plus hundreds more lines of logging):

由于错误条件,目标"InsertAdditionalWebCofigConnectionStrings"已跳过; ($(InsertAdditionalWebCofigConnectionStrings)和'@(_ ConnectionStringsToInsert)'!='') 被评估为(True And''!=''). 在文件"C:\ Program Files"中定位"_CleanWPPIfNeedTo" (x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Web \ Microsoft.Web.Publishing.targets来自 项目"C:_Application \ proj \ src \ proj.Web \ proj.Web.csproj" (目标"PipelineCollectFilesPhase"取决于它): 任务"ReadLinesFromFile"

Target "InsertAdditionalWebCofigConnectionStrings" skipped, due to false condition; ($(InsertAdditionalWebCofigConnectionStrings) And '@(_ConnectionStringsToInsert)' != '') was evaluated as (True And '' != ''). Target "_CleanWPPIfNeedTo" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets" from project "C:_Application\proj\src\proj.Web\proj.Web.csproj" (target "PipelineCollectFilesPhase" depends on it): Task "ReadLinesFromFile"

在CI服务器上,该目录似乎丢失了:

On the CI server, this directory appears to be missing:

C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Web \ Microsoft.Web.Publishing.targets

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets

缺少目标会导致它无声地失败吗?该文件夹来自哪里(丢失了CI服务器上的整个Web文件夹)?

Would a missing targets cause it to fail silently? Where does this folder come from (missing the entire Web folder on the CI server)?

推荐答案

您是否在生成服务器上安装了Visual Studio?乍一看似乎很奇怪(而且并非绝对必要),但这无疑是解决所有这些问题的最简单方法.

Have you installed Visual Studio on your build server? It seems like a strange thing to do at first (and isn't strictly necessary), but it certainly in the easiest way to resolve all these issues.

您可以将所需的目标文件从PC手动复制到构建服务器,但是您将通过反复试验来使其正​​常工作.

You can manually copy the required targets files from your PC on to the build server, but you'll be playing a trial and error game to get it to work.

如果MS像他们最近发布的Asp.Net and Web Tool 2012.2那样发布新的out of band更新,则与尝试确定已更改的目标并手动复制目标相比,构建服务器的安装过程要容易得多.

Also if MS release new out of band updates, like Asp.Net and Web Tool 2012.2 which they did recently, it's a much easier install procedure for the build server than to try and work out what targets have changed and copy them up manually.

让我知道这是否有帮助.

Let me know if this helps.

这篇关于Web Deploy 3.0在CI服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆