Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 574
Manvinder Avatar asked May 17 '12 10:05

Manvinder


People also ask

How do I manage updates for a ClickOnce application?

Click the Publish tab. Click the Updates button to open the Application Updates dialog box. In the Application Updates dialog box, make sure that the check box The application should check for updates is selected. In the Choose when the application should check for updates section, select After the application starts.

How do I deploy one click application?

In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from. In the Settings page, you can provide the settings necessary for ClickOnce.

How do I enable ClickOnce Security settings?

To enable ClickOnce security settings With a project selected in Solution Explorer, on the Project menu, click Properties. Click the Security tab. Select the Enable ClickOnce Security Settings check box. You can now customize the security settings for your application on the Security page.


2 Answers

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.

like image 188
manav inder Avatar answered Sep 20 '22 06:09

manav inder


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.

like image 35
avs099 Avatar answered Sep 22 '22 06:09

avs099