This project is read-only.

Orchard deployment - build Precompiled failed, No stage folder created

Topics: Troubleshooting
Jan 21, 2015 at 5:32 AM
Hi fellow Orchards

I have finished the development of a website for a client, and now I am about to deploy it.
I have deployed it before just to show a site preview of the development to the client and everything went smooth.

When I now run build precompiled from the VS2013 developer command tool, the only folder created under the build folder is the compiled folder, so the precompiled and stage folder where not created.

This is the message I get after running build precompiled:
Done Building Project "C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projec
ts\MCS Orchard\src\Orchard.Web\Modules\Tekno.Bootstrap\Tekno.Bootstrap.csproj"
(default targets).

Done Building Project "C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projec
ts\MCS Orchard\src\Orchard.sln" (Build target(s)) -- FAILED.

Done Building Project "C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projec
ts\MCS Orchard\Orchard.proj" (precompiled target(s)) -- FAILED.


"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\Orchard
.proj" (precompiled target) (1) ->
(Clean target) ->
  C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\Orchar
d.proj(108,5): warning MSB3231: Unable to remove directory "C:\Users\WilliamHol
m\Documents\Visual Studio 2013\Projects\MCS Orchard\build". The directory is no
t empty.\r
C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\Orchard.
proj(108,5): warning MSB3231:

"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\Orchard
.proj" (precompiled target) (1) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.sln" (Build target) (2:2) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.Web\Orchard.Web.csproj.metaproj" (default target) (3:2) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.Tests.Modules\Orchard.Tests.Modules.csproj" (default target) (35:5) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj" (default target) (11
:6) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj" (default target) (
9:12) ->
(ResolveAssemblyReferences target) ->
  C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targe
ts(1697,5): warning MSB3277: Found conflicts between different versions of the
same dependent assembly that could not be resolved.  These reference conflicts
are listed in the build log when log verbosity is set to detailed. [C:\Users\Wi
lliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orchard.Web\Mod

"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\Orchard
.proj" (precompiled target) (1) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.sln" (Build target) (2:2) ->
"C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orc
hard.Web\Themes\PJS.Bootstrap\PJS.Bootstrap.csproj" (default target) (80:2) ->
(_CopyWebApplicationLegacy target) ->
  C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\M
icrosoft.WebApplication.targets(182,5): error MSB3030: Could not copy the file
"Content\apple-touch-icon.png" because it was not found. [C:\Users\WilliamHolm\
Documents\Visual Studio 2013\Projects\MCS Orchard\src\Orchard.Web\Themes\PJS.Bo

    2 Warning(s)
    1 Error(s)

Time Elapsed 00:06:58.41

C:\Users\WilliamHolm\Documents\Visual Studio 2013\Projects\MCS Orchard>
Can someone please help me with understanding this error message and what to do about it?

By the way, if there is any other way to deploy Orchard, maybe through visual studio, and someone could point me in the direction of some resources, that are showing how to do it, it would be much appreciated.


Jan 24, 2015 at 11:39 AM
Edited Jan 24, 2015 at 11:40 AM
Ok, i fixed the 1 error by adding the missing file. Now the build succeeded and created the compile, precompiled and stage folder. However, i now get 22 errors - And in the stage folder, my media files are not present, so i have to copy them from source project. As well as my modules in the stage folder are missing their stylesheets.. Can someone explain why? And maybe elaborate on the best practice for deploying Orchard? I will gladly make a blog post about it afterwards - as i think the resources about how to deploy orchard are fairly scarce.

These are my errors now when running build precompiled:

(I posted it on pastebin as this forum can not have a post that exceeds 10000 characters.)

Jan 26, 2015 at 9:25 PM
For the errors, try to select all the *.ts typescript files in Modules/Orchard.Azure.MediaServices/Scripts folder, and in the "Generation Action" property select "Content" in place of "None". But, as you, no media files

You can also right click on the Orchard.Web project and do "Publish", then select a custom one, input a publish name..., select the "File System" option... Then, you will get a precompiled package. Here, I've got the media files

Jan 27, 2015 at 12:28 PM
Edited Jan 27, 2015 at 12:28 PM
Hi jtkech,

thanks for your reply.

I am running VS2013 Ultimate, so i guess it is the "Build action" property, as i can't find any "Generation action" property. But for those typescript files you mentioned the build action is set to "TypeScriptCompile". Tried to set it to content instead, but still got the same errors.

Okay i have tried it once to use the VS built in Publish feature the way you describe, but i could not get the site to show on my server. But i will try that again for sure.


Jan 27, 2015 at 3:37 PM
Which Orchard version do you have? So, I will be able to try again all the commands in the same context

Me too, I've VS2013 Ultimate, but in french version. Sorry for the wrong traduction, you're right, "Build action" is correct. For the .ts files, that's what I've got, but, after the update to "Content", I needed to re-build the solution before trying again the "build precompiled" command, maybe to save the .csproj file. So, try again

For the publish action, when I will know your version, I will try again...

Jan 27, 2015 at 7:32 PM
I run Orchard 1.8.1 - and yeah I did a clean and build after I changed the build action to "Content", that did not clear my errors..

But when publishing orchard through VS2013:

1) Right click Orchard.Web and press "Publish"
2) Create new custom profile
3) Set the publish method to "File System"
4) Set Configuration to "Release"
5) Under "File Publish Option" check the "Precompile during publishing" checkbox. Then press the "Configure" option to see advanced precompile settings
7) Here the "Allow precompiled site to be updateable" is checked and "Do not merge" is checked under merged options as standard.

Is that the right configuration for publishing Orchard? or am I missing something or some configurations?
Jan 27, 2015 at 10:16 PM
Here my last tests

Build precompiled

  1. Restart from my original 1.8.1 zip file, build under VS2013 (0 error), Orchard setup, import media files
  2. Open the dev console, go to the Orchard root, run "build precompiled" => 2 warnings, 17 errors and no media files
  3. The main message is about typescript files: "None" element name for include "*.ts" should be "Content"
  4. Select all Orchard.Azure.MediaServices/Scripts/*.ts files and change the "Build action" from "None" to "Content"
    Note: The "TypescriptCompile" option was only used for the Scripts/typings/*.ts files
  5. Click on "Save all", run again "build precompiled" => only 3 warnings, 0 error (still no media files)

Local publish

  1. Rebuild all under VS2013, right click on Orchard.Web and click "Publish"
  2. Select "Custom", input a name, select "File system", select a local folder destination
    Note: The config is "Release" by default, and I didn't check any "File Publish Option"
  3. Publish => Package without source files, only necessary *.dll in bin folders, and with media files
  4. With WebMatrix, open the package folder, start the site, it works
Jan 28, 2015 at 11:05 AM
By doing the steps you described in the build precompiled, I managed to clear all my errors and everything is good now, thanks!

I haven't tried the local publish method you described and i don't have webmatrix installed. But anyway thanks for your help!