Да, это возможно. Мы используем MSBuild для публикации через ClickOnce и загрузки по FTP.
Задачи Google MSBuild и задача по созданию сообщества MS
Это непроверенный фрагмент нашего скрипта сборки, и вам следует начать:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Documentation:
http://msbuildhg.codeplex.com/documentation
http://msbuildtasks.tigris.org/
-->
<PropertyGroup>
<MSBuildMercurialPath>.</MSBuildMercurialPath>
<MSBuildCommunityTasksPath>.</MSBuildCommunityTasksPath>
<BuildInputDir>src</BuildInputDir>
<BuildOutputDir>build</BuildOutputDir>
<TestOutputDir>test</TestOutputDir>
<PublishOutputDir>publish</PublishOutputDir>
<PublishDir>..\..\$(PublishOutputDir)</PublishDir>
<SolutionToCompile>$(BuildInputDir)\EventLogger.sln</SolutionToCompile>
<!-- Settings -->
<Company>Veodin</Company>
<Product>KeyRocket</Product>
<!-- ClickOnce deployment -->
<InstallUrl>http://download.veodin.com/keyrocket/</InstallUrl>
<UpdateUrl>http://download.veodin.com/update/keyrocket/</UpdateUrl>
<!-- Upload_FTP -->
<UploadMethod>FTP</UploadMethod>
<ftpHost>ftp.com</ftpHost> <!-- e.g. 'mroc.de' !!! -->
<ftpUser>user</ftpUser>
<ftpPass>password</ftpPass>
<ServerDir>/download/</ServerDir> <!-- E.g. 'downloads/test/' !!! -->
</PropertyGroup>
<Import Project="Tools\MSBuild.Mercurial.Tasks" />
<Import Project="Tools\MSBuild.Community.Tasks.Targets" />
<Target Name="Clean">
<Message Text="-------------------------------------------------------------------------------------------------------------------"/>
<RemoveDir Directories="$(BuildOutputDir)" />
<RemoveDir Directories="$(TestOutputDir)" />
<RemoveDir Directories="$(PublishOutputDir)" />
</Target>
<Target Name="Publish">
<Message Text="-------------------------------------------------------------------------------------------------------------------"/>
<Message Text="Publishing version $(Major).$(Minor).$(Build).$(Revision), Company=$(Company), Product=$(Product)"/>
<PropertyGroup>
<PublishArgs>Configuration=Automated_Build;PublishDir=$(PublishDir)\;InstallUrl=$(InstallUrl);UpdateUrl=$(UpdateUrl);ApplicationVersion=$(Major).$(Minor).$(Build).$(Revision);ApplicationRevision=$(Revision);IsWebBootstrapper=true;BootstrapperEnabled=true;PublisherName=$(Company);ProductName=$(Product)</PublishArgs>
</PropertyGroup>
<MSBuild
Projects="$(BuildInputDir)\VeodinKeyRocket\VeodinKeyRocket.csproj"
Targets="Clean"
Properties="$(PublishArgs)" />
<MSBuild
Projects="$(BuildInputDir)\VeodinKeyRocket\VeodinKeyRocket.csproj"
Targets="Rebuild"
Properties="$(PublishArgs)" />
<MSBuild
Projects="$(BuildInputDir)\VeodinKeyRocket\VeodinKeyRocket.csproj"
Targets="Publish"
Properties="$(PublishArgs)" />
</Target>
<Target Name="Upload_FTP" Condition=" '$(UploadMethod)' == 'FTP'">
<Message Text="-------------------------------------------------------------------------------------------------------------------"/>
<Message Text="Uploading to $(ftpHost)/$(ServerDir)" />
<FtpUploadDirectoryContent
ServerHost="$(ftpHost)"
Port="21"
Username="$(ftpUser)"
Password="$(ftpPass)"
LocalDirectory="$(PublishOutputDir)"
RemoteDirectory="$(ServerDir)"
Recursive="true" />
</Target>
<Target Name="Build" DependsOnTargets="Clean;Publish;Upload_FTP;">
<Message Text="Clean;Publish;Upload_FTP;"/>
</Target>
</Project>