MSBuild not copying files with PublishProfile
Asked Answered
D

2

7

I have a Visual Studio 2013 solution with the full Orchard source code. When I use "Publish..." on the "Orchard.Web" project in Visual Studio, it correctly publishes the site to the File System destination I've configured into the .PubXml file that I used.

However, if I build this site using Jenkins, the files do not get copied to the destination. I've created a separate PubXml file that is used by Jenkins.

In my Jenkins job, I have two Build steps of interest. The first uses the src\Orchard.sln file with a command line argument of /p:Configuration=Release. This runs correctly, and builds the entire solution.

The second Build step, immediately after, uses the Build File of src\Orchard.Web\Orchard.Web.csproj and these command line arguments:

  • /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

With this, the build and deploy seems to work - but doesn't. Here are some lines from the build output:

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

No where does it actually copy the files to the destination defined in the PUBXML file.

In contrast, in Visual Studio, the output looks similar, but transforms only 4 config files and includes lots of "Publishing folder x" lines:

(...)
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.)

(I have installed the latest Windows Azure SDK for .NET on the Jenkins server.)

Displode answered 23/7, 2014 at 16:54 Comment(0)
L
1

I have the same trouble,that work for me:

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

do not use /p:VisualStudioVersion=xxx

Lacquer answered 14/9, 2017 at 6:24 Comment(0)
R
0

This is kind of old, but I actually just set up Orchard to be able to get built via command line and MSBuild. Here is what I did:

/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

Since you are using Orchard you want to make sure that only the Orchard.Web project gets published so do not use DeployOnBuild=true. This will attempt to deploy every web project in the solution, which is a lot for Orchard. Instead follow the guidelines here to see how to deploy only the web project: http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx

Rubberneck answered 20/4, 2015 at 14:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.