简体   繁体   中英

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;

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 build successfully but output of that project will be copied on debug folder of application in app.publish folder.

How should i handle this thing. Thanks

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM