index > Team Foundation Server - Build Automation > How to publish (clickonce) a solution

How to publish (clickonce) a solution


Hi,

I havent been able to find anything to help me to do this. I can do this manually thru the IDE, but not thru the Build Types.

What do I have to place in the Build Type to get the program and its files published to our website?

I tried the following with no luck I just get an Entry Point error and I dont understand why. Please help.

========

<GenerateApplicationManifest

AssemblyName="AdminUtilGUI.exe"

AssemblyVersion="1.28.1.0"

EntryPoint="@(EntryPoint)"

OutputManifest="\\dalxpdss\DMDB_CODE\MARS Branch Project\DailyBuild2\Sources\daily build\MARS_Platform\Tools\MarsServerAdmin\SysAdminTools\obj\Release\AdminUtilGUI.exe.manifest">

<Output

ItemName="ApplicationManifest"

TaskParameter="OutputManifest"/>

</GenerateApplicationManifest>

<GenerateDeploymentManifest

AssemblyName="AdminUtilGUI.application"

AssemblyVersion="1.28.1.0"

DeploymentUrl="http://dalengmarsweb01:8080/SysAdminUtility/AdminUtilGUI.exe"

EntryPoint="@(ApplicationManifest)"

Install="false"

OutputManifest="\\dalxpdss\DMDB_CODE\MARS Branch Project\DailyBuild2\Sources\daily build\MARS_Platform\Tools\MarsServerAdmin\SysAdminTools\obj\Release\AdminUtilGUI.application">

<Output

ItemName="DeployManifest"

TaskParameter="OutputManifest"/>

</GenerateDeploymentManifest>

=========

Note: Im building several solutions in the Build Type, but I only want to publish the one solution.

Please help.

Thanks,

Staffan

Sweed

I also tried:

<MSBuild

Condition=" '@(SolutionToBuild)'!='' "

Projects="@(SolutionToBuild)"

Properties="Configuration=%(ConfigurationToBuild.FlavorToBuild);Platform=%(ConfigurationToBuild.PlatformToBuild);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\TFSBuild.vsprops;FxCopDir=$(FxCopDir);OutDir=$(OutDir);PublishDir=$(OutDir);ReferencePath=$(ReferencePath);TeamBuildConstants=$(TeamBuildConstants);$(CodeAnalysisOption);PublishDir=\\kiran-test1\drops\publishme\ "

Targets="Publish" />

but I only want this solution output published:

<SolutionToBuild Include="$(SolutionRoot)\daily build\MARS_Platform\Tools\MarsServerAdmin\SysAdminTools.sln" />

How do I do this?

Sweed

I think I got it to somewhat work.

This is what Im using:

<!-- BEGIN TRYING 20061010 SS Trying to Publish AdminToolGUI to web-->

<MSBuild

Condition=" '@(SolutionToBuild)'!='' "

Projects="$(SolutionRoot)\daily build\MARS_Platform\Tools\MarsServerAdmin\SysAdminTools.sln"

Properties="Configuration=%(ConfigurationToBuild.FlavorToBuild);Platform=%(ConfigurationToBuild.PlatformToBuild);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\TFSBuild.vsprops;FxCopDir=$(FxCopDir);OutDir=$(OutDir);PublishDir=$(OutDir);ReferencePath=$(ReferencePath);TeamBuildConstants=$(TeamBuildConstants);$(CodeAnalysisOption);PublishDir=\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\ "

Targets="Publish" />

<!-- END TRYING 20061010 SS Trying to Publish AdminToolGUI to web-->

Im getting the following error now:

Copying file from "D:\DMDB_CODE\MARS Branch Project\DailyBuild2\Binaries\Release\AdminUtilGUI.exe.manifest" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.manifest".
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3248,9): error MSB3021: Unable to copy file "D:\DMDB_CODE\MARS Branch Project\DailyBuild2\Binaries\Release\AdminUtilGUI.exe.manifest" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.manifest". Access to the path '\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.manifest' is denied.
Copying file from "obj\Release\AdminUtilGUI.exe" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.deploy".
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3248,9): error MSB3021: Unable to copy file "obj\Release\AdminUtilGUI.exe" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.deploy". Access to the path '\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.deploy' is denied.
Copying file from "App.config" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.config.deploy".

I think I understand the Access Denied. The directory already exists, but Ill remove/rename it to see if that works.

Where is 1_28_1_0 coming from? I dont have it defined anywhere in my TFSBuild.proj

Thanks,

staffan

Sweed

I tried this now and it is closest Im getting, but I keep getting errors:

<MSBuild

Condition=" '@(SolutionToBuild)'!='' "

Projects="$(SolutionRoot)\daily build\MARS_Platform\Tools\MarsServerAdmin\SysAdminTools.sln"

Properties="Configuration=%(ConfigurationToBuild.FlavorToBuild);Platform=%(ConfigurationToBuild.PlatformToBuild);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\TFSBuild.vsprops;FxCopDir=$(FxCopDir);OutDir=$(OutDir);PublishDir=$(OutDir);ReferencePath=$(ReferencePath);TeamBuildConstants=$(TeamBuildConstants);$(CodeAnalysisOption);PublishDir=\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\ "

Targets="Publish" />

=======================

The errors I get are:

_______________________

Target _CopyFilesToPublishFolder:
Creating directory "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0".
Copying file from "D:\DMDB_CODE\MARS Branch Project\DailyBuild2\Binaries\Release\AdminUtilGUI.exe.manifest" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.manifest".
Copying file from "obj\Release\AdminUtilGUI.exe" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.deploy".
Copying file from "App.config" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.config.deploy".
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3248,9): error MSB3021: Unable to copy file "App.config" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.config.deploy". Access to the path '\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\AdminUtilGUI.exe.config.deploy' is denied.
Creating directory "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts".
Copying file from "Database Scripts\Create Script.sql" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\Create Script.sql.deploy".
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3248,9): error MSB3021: Unable to copy file "Database Scripts\Create Script.sql" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\Create Script.sql.deploy". Access to the path '\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\Create Script.sql.deploy' is denied.
Copying file from "Database Scripts\DropALL Script.sql" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\DropALL Script.sql.deploy".
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3248,9): error MSB3021: Unable to copy file "Database Scripts\DropALL Script.sql" to "\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\DropALL Script.sql.deploy". Access to the path '\\dalengmarsweb01\SysAdminUtilGUI\SysAdminUtility\AdminUtilGUI_1_28_1_0\Database Scripts\DropALL Script.sql.deploy' is denied.
Done building target "_CopyFilesToPublishFolder" in project "AdminUtilGUI.csproj" -- FAILED.

Checked the directory permissions and they seem fine. I set to read/write. Looks like for some reason the files are trying to rename themselves. Why is that? Has anyone successfully done Publishing via the Build Type successfully? Im struggling now.

please help.

Thanks,
Staffan

Sweed

Typically you would just want to put your single solution into a <SolutionToPublish> item group in TfsBuild.proj rather than <SolutionToBuild>. In Microsoft.TeamFoundation.Build.targets, the solution will then have its Publish target called rather than its Build target. There may still be issues with getting it published to your web server, however - I believe it normally just ends up in the standard drop location.

-Aaron




http://blogs.msdn.com/aaronhallberg
Aaron Hallberg

Hi Aaron,

Thanks for responding. Yeah, Im one of those having problems :-(

Im trying something different to see if it works different. Ill post what I tried after I try it at least once :-)

Thanks,

Staffan

Sweed
reply 6

You can use google to search for other answers

 

More Articles

Help on importing schema
Generating Build Reports
Why is my TFS build taking so long to complete?
Team Build Test Config Deployment Issue
Running diff. test lists under diff. testconfigs?
How to rebuild the TeamProject based on a specific label?
TF42057: build request is not from the configured team foundation...
Standard way to get BVT status.....
How to set version information in a builded exe file
Getting a project from another Team Project (RC)
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

newbie in build automation.
Undefined variable in TFS Build (MSB4102)
Shared Components between VSTS Projects
How To Build/Maintain Customer Branches
Team Foundation Build status is "Fa…
TFS to do Builds and Test vs Manual proc…
LastGoodBuildNumber
automated unit tests
AssemblyInfo MSBuil task
web.config file section replacement
FileVersion automation
Build fails with: The binary form of an …
Looping and extracting all folder names …
Parrallel builds conflict over code cove…
Team Build Failure

Hot Articles

Nightly build problem
Target against a specific .Net version?
Team Build: Object reference not set to …
Custom(ish) Build Number.
AfterBuild target is being skipped
newbie in build automation.
Setting Build Status
multi-platform project dependencies
Disabling Visual Studio build events
Build problem TF42004
Error when retrieving run from TFS ?
Stopping a running Build...
More than 1 SolutionToBuild
Traffic to the teamsystem server after a…
Incrementing automatically the third fie…

Recommend Articles

BuildStatusChangeEvent doesn't work.
Building project which referring dlls fr…
Can we use ($TargetPath) in post-build e…
Using AssemblyMajorVersion to update Ass…
DLL's build on TFS is different and inco…
I want to add dotfuscator automatica…
Team Build with Multiple Projects fails …
Custom Bin Directory
How to do strong name signing and digita…
team build
Having issues with Team Build
Build for setup project failing
How to build only project, not soluion.
How to change default "assigned to&…
Team Build and ClickOnce