How to Publish a ClickOnce Application Using Microsoft.Build.BuildEngine

I have a WPF, ClickOnce application that I am trying to build using Microsoft.Build.BuildEngine.

I believe my question really boils down to "how do I execute the command line / target: publish with Microsoft.Build.BuildEngine"?

I have tried the following

projectToBuild.SetProperty("PublishUrl", myPublishUrl);
projectToBuild.Targets.AddNewTarget("publish");

      

but i'm really just guessing about these properties based on the command line properties i set to publish the ClickOnce application.

+2


source to share


1 answer


Targets.AddNewTarget is a mechanism for creating a new target.

It looks like the mechanism for building the target is to use a string parameter in .Build ():



projectToBuild.Build("publish");

      

+2


source







All Articles