9
votes

We use teamcity to deploy several of our projects. I'm attempting to setup the deploy of an orchard project, and I'm currently running into some issues.

I have the teamcity project building and notifying of successful and failed builds. When I add a deploy step and run it, I get the following error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3460, 5): error MSB4044: The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName".

I can't tell if it's just me not configuring the build step properly, or if it has trouble with orchard. Has anyone has success deploying orchard projects from TeamCity, and can you help shed some light on this issue?

6

6 Answers

27
votes

I had the same problem and fixed it by going to the 'Publish/Package Web' tab in the Visual Studio project settings and specifying the IIS Website name under 'IIS Web site/application name to use on destination server'.

You can also specify DeployIisAppPath as an MS build arguement in TeamCity.

3
votes

Setting the following parameter in the project file settings worked for me.

Default Web Site/MySampleWebSite

2
votes

I added this to the csproj file (manual edit using a text editor)

  <PropertyGroup> ...
   <DeployIisAppPath>mysite</DeployIisAppPath>
  </PropertyGroup>

and that took care of the error...

1
votes

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.

1
votes

Ran into the same error getting my deployments automated using bamboo. In my case I have two projects a web application project and a class library that the web application depends on. When I ran the deployment using the msbuild deployment commandline the class library dependency would build and fail with the missing SiteAppName Error (Looking at the diagnostic logs it appears to be trying to deploy my class library).

To get around the problem I ended building the entire project first and then running the msbuild deployment without rebuilding the class library by adding /p:BuildProjectReferences=false to the msbuild deployment commandline.

-4
votes

I found the problem, we had some permissions not correctly set for the deploy user on the web server. I was able to give the user correct