我没有运气使用 Visual Studio 2010 一键发布部署 Orchard CMS。*.targets 文件确实存在一些问题。
我认为它应该发布的方式是使用Orchard.proj
file. 它具有生成正确的 Web 部署包所需的一切:当您msbuild /t:Build Orchard.proj
调用~\artifacts\MsDeploy\Orchard.Web.zip
. 此软件包已准备好部署。您可能想要编辑manifest.xml
,parameters.xml
具体取决于您想要完成的工作。同样适用于Orchard.proj
:您可能希望在那里启用一些禁用的模块等。
我还将在使用时发布示例 msdeploy 脚本:
部署.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%
这篇博文可能会有所帮助。