Manvinder
Manvinder

Reputation: 4587

How to Set PublishUrl of ClickOnce Application From CommandLine

I am working on a ClickOnce application. I am trying to publish it from command line using this:

msbuild Project.csproj /t:Publish /p:configuration=release;

The problem is I want to set some other properties along with configuration, like 'PublishUrl' etc.

I've tried this:

msbuild Project.csproj /t:Publish /p:configuration=release;publishurl="\\sdmm\publish\"

It builds successfully but the output of that project will be copied to the debug folder of application in app.publish folder.

How should I handle this thing? Thanks.

Upvotes: 7

Views: 3598

Answers (2)

manav inder
manav inder

Reputation: 3601

You could set any property you want from the command line but before doing so, you need to open your .csproj file in some texteditor(notepad etc). Find the property that you want to edit. In your case it is publish url. Remove this property from csproj file.

Then you could do this

msbuild /target:clean,publish /p:publishurl=c:\publish_location\

you must clean the project before you publish it.

Upvotes: 11

avs099
avs099

Reputation: 11227

Try to change your target to

msbuild /target:clean,rebuild,publish

because property you are overriding (PublishUrl) was not embedded into application file if only "Publish" target is used.

Upvotes: 7

Related Questions