It only took 5 days for somebody to respond to my question on the MSDN Forums: “Publish XBAP applications from msbuild?”.
I had already found an unsatisfactory answer by the time the moderator answered my post.
First, the approach using the target publish didn’t work for. I’d really like it to, but it didn’t. So the alternative was to copy the files to their destination. Along the way you need to rename append “.deploy” to all exe, dll and config files. This approach works alright, but is not the same as publish.
For now I’ve automated the process by writing a power shell script that I run either from my msbuild file or from the command line depending upon what I’m up to. The script is easy enough:
Write-Host "copying files to $DesployDirectory"
foreach($file in $BuildOutput)
{
$sourceFile = "$BuildOutputDirectory\$file"
$destinationFile = "$DeployDirectory\$file"
if($file.EndWith('.exe') || $file.EndsWith('.dll') || $file.EndsWith('.config'))
{
$destinationFile += '.deploy'
}
copy $sourceFile $destinationFile
}
Write-Host "Done."