Newbie about to pull own heair out - deploying Orchard

Topics: Administration, Installing Orchard, Troubleshooting
Nov 27, 2013 at 1:49 PM
Hi all,
 I have the source code for orchard on my machine, I've been running it via VS2012 and have a nice little orchard site running on my desktop.
I now want to deploy it to my web hosting provider.
I can publish via VS2012 and it does indeed move files onto my provider

HOWEVER - it's an EXE.
Can anyone tell me how I can take my VS2012 project and deploy it as a website.

and I know some of you must be laughing at such a simple question, apologies for that, but I'm about to rip out my own hair.

Thanks in advance,
Paul.
Developer
Nov 27, 2013 at 9:25 PM
What I usually do is:
  1. Open Orchard.proj (in the root folder) and change the first line to: "if "%~1"=="" build Precompiled"
  2. Run the ClicktoBuild.cmd file
  3. When done, I then upload the contents of the "stage/precompiled" folder to my server.
  4. I upload the database as necessary and update Settings.txt with the one on my local.
Nov 28, 2013 at 9:16 AM
Hi Skywalker,
do you mean like this:
"if "%~1"=="" build Precompiled"
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Initialization --> <PropertyGroup>

I tried it without the first and last quotes as well but when I click on the clicktobuild I get an error

C:\CMS\orchard backup\Orchard.proj(1,1): error MSB4025: The project file could not be loaded. Data at the root level is
invalid. Line 1, position 1.
Done Building Project "C:\CMS\orchard backup\Orchard.proj" (Build target(s)) -- FAILED.

Please can you tell me what I'm doing wrong.

Thanks in advance,
Paul.
Nov 28, 2013 at 10:54 PM
I found the solution now.

When you select your publish settings select file system and select all files for project.

The folder that you deply to can then be copied to your hosting provider as a complete deliverable.

but thanks for the input,
Paul.
Jan 15, 2015 at 8:37 PM
Edited Jan 15, 2015 at 8:39 PM
Paul33a wrote:
Hi Skywalker,
do you mean like this:
"if "%~1"=="" build Precompiled"
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Initialization --> <PropertyGroup>

I tried it without the first and last quotes as well but when I click on the clicktobuild I get an error

C:\CMS\orchard backup\Orchard.proj(1,1): error MSB4025: The project file could not be loaded. Data at the root level is
invalid. Line 1, position 1.
Done Building Project "C:\CMS\orchard backup\Orchard.proj" (Build target(s)) -- FAILED.

Please can you tell me what I'm doing wrong.

Thanks in advance,
Paul.
For anyone else having issues with running the .cmd files to make a precompiled version of your site, like I was, you can do one of the following things (applies to Orchard 1.8.1):

Option 1: Right-click on build.cmd, click Edit, highlight the first line and replace it with:
if "%~1"=="" build Precompiled
Then just save, exit out of the file, and run ClickToBuild.cmd as an admin.

Option 2: Make a copy of both build.cmd and ClickToBuild.cmd and put them in the same folder. Rename them to something descriptive (such as buildPrecompiled.cmd and ClickToBuildPrecompiled.cmd), right-click on your new buildPrecompiled.cmd file and make the exact same changes as in option 1 above. Finally, close out of that, right-click on your new ClickToBuildPrecompiled.cmd file, click Edit. Now look towards the bottom of the file, under :build, and find the following line:
call build
And change it to:
call buildPrecompiled
Mar 18, 2015 at 9:49 PM
A recent 1.x update overwrote my Build.cmd/ClickToBuild files and removed a number of web.config files. My project no longer builds, using the Precompiled method Skywalker proposes above, as a result. Is there a method for getting this back that others might suggest. I hate resetting my branch.
Mar 19, 2015 at 1:36 AM
Got a hand from the man. I'm OK here. We had to add back a bunch of files and rollback some changes in my repo. Still on the learning curve I guess...
Mar 19, 2015 at 3:56 PM
Edited Mar 19, 2015 at 3:57 PM
For the record and maybe other noobs. If you're following the 1.x branch the Build.cmd and ClickToBuild.cmd files changed recently.

Build.cmd now says:

clicktobuild %*

To continue building with Precompiled. Update line 23 of ClickToBuild.cmd.

Before:
IF "%target%" == "" SET target=Build

After:
IF "%target%" == "" SET target=Precompiled

Must seem painfully obvious but this tripped me up and maybe just maybe others as well. It's weird, I've gotten pretty competent with the module and theme development side but still trip on basic "how Orchard works" pieces.

T