I had no luck deploying Orchard CMS using Visual Studio 2010 1-click Publish. It indeed had some problems with *.targets file.
I think the way it should be published is using Orchard.proj
file. It have everything needed to generate proper web deployment package:
When you call msbuild /t:Build Orchard.proj
, it compiles everything, places proper files at proper locations in temp folders and then generates ~\artifacts\MsDeploy\Orchard.Web.zip
.
This package is ready to be deployed. You might want to edit manifest.xml
and parameters.xml
depending on what you want to get done. Same for Orchard.proj
: you might want to enable some of disabled modules there etc.
I'm also going to post sample msdeploy script while i'm at it:
deploy.cmd:
@echo off
set site=sitename.com
set user=iis_manager_login
set pass=password
set host=wmsvc='https://hosting.provider.com:8172/msdeploy.axd?site=%site%',userName='%user%',password='%pass%',authtype='Basic'
set cmd=-allowUntrusted -verbose
echo on
::This command puts app_Offline.htm to web application root, asp.net will
::automatically shut down instantly. My hosting provider does not let me use
::recycleApp Provider anyway. I am also not able to use filePath Provider.
::That's why I use contentPath.
msdeploy -verb:sync -source:contentPath='%CD%\lib\msdeploy\app_Offline.htm' -dest:contentPath="%site%\app_Offline.htm",%host% %cmd%
::This is the main deploy command. It will apply every provider listed in
::manifest.xml, applying changed written in parameters.xml.
::It will also skip Media, Settings.txt and app_Offline.htm itself.
::Without skip directive, it would all get removed.
::Deploy will try to delete folders that do not exist in Orchard.Web.zip
::You might have a need to add something like
::<WriteLinesToFile File="$(StageFolder)\App_Data\Sites\Default\_placeholder.txt" Lines="some_text" Overwrite="true"/>
::to your Orchard.proj
msdeploy -verb:sync -source:package='artifacts\MsDeploy\Orchard.Web.zip' -dest:auto,%host% -setParam:name='Application Path',value='%site%' -skip:File='%site%\\App_Data\\Sites.*Settings.txt' -skip:File='%site%\\app_Offline.htm' -skip:Directory='%site%\\Media' %cmd%
::Remove app_Offline.htm, now your site can start up.
msdeploy -verb:delete -dest:contentPath="%site%\app_Offline.htm",%host% %cmd%
Probably this blog post can be helpful.