MSBuild does not copy files using PublishProfile

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

However, if I create this site using Jenkins, the files will not be copied to the destination. I created a separate PubXml file that is used by Jenkins.

In my Jenkins work, I have two build steps. The first uses the src\Orchard.sln with the /p:Configuration=Release command line argument. This runs correctly and creates the whole solution.

The second build step immediately uses the build file 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
  • / r: Platform = AnyCPU
  • / v: minimal
  • / nologo
  • / p: WarningLevel = 1

With this, assembly and deployment seem to work, but it is not. Here are a few lines from the output of the assembly:

 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 specified in the PUBXML file.

On the contrary, in Visual Studio, the output looks similar, but it only converts 4 configuration files and includes many lines of "Publish folder 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.) 

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

+6
source share
2 answers

I have the same problem as work for me:

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

do not use / p: VisualStudioVersion = xxx

0
source

It's kind of old, but I actually just installed Orchard to be able to build on the 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 is published, therefore it does not use DeployOnBuild = true. . This will try to deploy every web project in a solution that is a lot for Orchard. Instead, follow the guidelines here to learn how to deploy only a web project: http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx

0
source

Source: https://habr.com/ru/post/972717/


All Articles