Jeremy E
Jeremy E

Reputation: 3704

Publish ClickOnce app with MSBuild

I need a way to use MSBuild to publish a ClickOnce App to multiple PublishDir(s). I have four environment (dev, qa, model, prod) and need to generate seperate ClickOnce PublishDir(s) for each because the config files are different. One of the main issues is that MSBuild doesn't create a publish.htm file. Any help would be appreciated.

Upvotes: 5

Views: 9345

Answers (4)

Yashoda Chandrasekara
Yashoda Chandrasekara

Reputation: 89

var globalProperty = new Dictionary();

globalProperty.Add("Configuration", "Release");

var buildRequest = new BuildRequestData(projectFileName, globalProperty, "15.0", new String[] { "Publish" }, null);

hope this will help someone

("15.0" because I'm using visual studio 2017)

Upvotes: 0

wallismark
wallismark

Reputation: 1856

and this solves the multiple environment issue (well, it is one way of solving the problem)

http://wallism.wordpress.com/2009/12/21/msbuild-and-multiple-environments/

Upvotes: 4

Mark
Mark

Reputation: 69

I just blogged an answer to the publish.html problem, in the next couple of days I'll blog about the multiple environment issue.

http://wallism.wordpress.com/2009/12/08/clickonce-creating-publish-page-from-msbuild/

Upvotes: 6

andyhammar
andyhammar

Reputation: 1443

How about, as a one-time thing, manually creating the publish.htm files in the four locations?

At my company, we don't use the publish.htm file at all. But we do have different environments, so we let the build-script change app name, update location, server uri etc pre-build and the build it with target Publish. The output files are thereafter copied to the location of the environment in question.

We are a bit old and are doing this mostly in a cmd file, but I'm sure you could have 4 different msbuild targets that does the same job.

Upvotes: 5

Related Questions