MSBuild未使用PublishProfile复制文件

7
我有一个带有完整Orchard源代码的Visual Studio 2013解决方案。当我在Visual Studio中使用“发布...”功能在“Orchard.Web”项目上时,它会将站点正确地发布到我已经配置到所使用的.PubXml文件中的文件系统目标。
然而,如果我使用Jenkins构建此站点,则文件不会复制到目标位置。我已经创建了单独的PubXml文件供Jenkins使用。
在我的Jenkins任务中,我有两个重要的构建步骤。第一个使用src\Orchard.sln文件,并带有一个/p:Configuration=Release的命令行参数。这运行正确,并生成整个解决方案。
第二个构建步骤紧随其后,使用src\Orchard.Web\Orchard.Web.csproj的构建文件,以及以下命令行参数:
  • /p:DeployOnBuild=true
  • /p:PublishProfile="D:\workspace\Site\trunk\src\Orchard.Web\Properties\PublishProfiles\Jenkins.pubxml"
  • /p:VisualStudioVersion=12.0
  • /p:Configuration=Release
  • /p:Platform=AnyCPU
  • /v:minimal
  • /nologo
  • /p:WarningLevel=1
通过此方法,构建和部署似乎可以工作 - 但实际上并非如此。以下是构建输出中的几行内容:
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Auto ConnectionString Transformed obj\Release\Package\PackageTmp\Shapes\Scripts\Web.config into obj\Release\CSAutoParameterize\transformed\Shapes\Scripts\Web.config.
(... about 200 more "Auto ConnectionString..." lines...)
Finished: SUCCESS

在PUBXML文件中定义的目标位置上,实际上没有复制文件。

相比之下,在Visual Studio中,输出看起来类似,但只转换了4个配置文件,并包含大量“发布文件夹x”的行:

(...)
Transformed Modules\SH.GoogleAnalytics\web.config using ....
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Publishing folder /...
Publishing folder bin...
(etc.)

我已在Jenkins服务器上安装了最新的用于.NET的Windows Azure SDK。

2个回答

1

我也遇到了相同的问题,以下方法对我有效:

/t:Rebuild
/p:DeployOnBuild=true
/p:PublishProfile=Jenkins_Publish
/p:Configuration=Release

不要使用 /p:VisualStudioVersion=xxx。

0

虽然这有点老,但我最近刚刚设置好了Orchard能够通过命令行和MSBuild进行构建的方式。以下是我的做法:

/p:VisualStudioVersion=12.0;PublishProfile="example-profile";DeployProjA=true;FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v4.5";Configuration=Release;PublishProfileRootFolder=c:\Workspace\src\Orchard.Web\Properties\PublishProfiles;Password=ExamplePass

既然您正在使用Orchard,您要确保只发布Orchard.Web项目,因此不要使用DeployOnBuild = true。 这将尝试部署解决方案中的每个Web项目,这对于Orchard来说是很多的。相反,请按照这里的指南,了解如何仅部署Web项目:http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接