Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 498701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:54:37+00:00 2026-05-13T05:54:37+00:00

I’m trying to make a batch file to publish the few ClickOnce application we

  • 0

I’m trying to make a batch file to publish the few ClickOnce application we have in one click. I’m using msbuild for that, and as an example the below command line shows how I’m doing it:

msbuild
    MyApp.sln
    /t:Publish
    /p:Configuration=Release
    /p:PublishUrl="C:\Apps\"
    /v:normal > Log.txt

(wrapped for easier reading)

when I run the above command it builds and publish the application in the release directory, i.e. bin\release! Any idea why msbuild doesn’t respect PublishUrl property in my example above?

PS: I tried also different combinations including remove ‘Configuration’, use ‘Rebuild’ and ‘PublishOnly’ as targets, and remove the the quotation marks but without any success.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:54:37+00:00Added an answer on May 13, 2026 at 5:54 am

    Some features are done by Visual-Studio and not by the MSBuild-script. So the click-once-deployment behaves differently when it’s executed from the command-line.

    • The ApplicationRevision isn’t increased with every build. This works only when is exectued from Visual Studio
    • In in somecases, the PublishUrl isn’t used. Quote from MSDN:

      For example, you could set the PublishURL to an FTP path and set the InstallURL to a Web URL. In this case, the PublishURL is only used in the IDE to transfer the files, but not used in the command-line builds. Finally, you can use UpdateUrl if you want to publish a ClickOnce application that updates itself from a separate location from which it is installed.

    I’ve created a special MSBuild-file which does this things. It runs the publish-target and copies then the files to the right location.

    An example of the build-file, as requested by alhambraeidos. It basically runs the regular VisualStudio-build and then copies the click-once data to the real release folder. Note that removed some project-specific stuff, so it’s maybe broken. Furthermore it doesn’t increase the build-number. Thats done by our Continues-Build-Server:

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <PropertyGroup>
            <!-- the folder of the project to build -->
            <ProjLocation>..\YourProjectFolder</ProjLocation>
            <ProjLocationReleaseDir>$(ProjLocation)\bin\Release</ProjLocationReleaseDir>
            <ProjPublishLocation>$(ProjLocationReleaseDir)\app.publish</ProjPublishLocation>
            <!-- This is the web-folder, which provides the artefacts for click-once. After this
             build the project is actually deployed on the server -->
            <DeploymentFolder>D:\server\releases\</DeploymentFolder>
        </PropertyGroup>
    
    
        <Target Name="Publish" DependsOnTargets="Clean">
            <Message Text="Publish-Build started for build no $(ApplicationRevision)" />
            <MSBuild Projects="$(ProjLocation)/YourProject.csproj" Properties="Configuration=Release" Targets="Publish"/>   
    
    
            <ItemGroup>
                <SchoolPlannerSetupFiles Include="$(ProjPublishLocation)\*.*"/>
                <SchoolPlannerUpdateFiles Include="$(ProjPublishLocation)\Application Files\**\*.*"/>
            </ItemGroup>
            <Copy
                SourceFiles="@(SchoolPlannerSetupFiles)"
                DestinationFolder="$(DeploymentFolder)\"
            />
            <Copy
                SourceFiles="@(SchoolPlannerUpdateFiles)"
                DestinationFolder="$(DeploymentFolder)\Application Files\%(RecursiveDir)"
            />      
            <CallTarget Targets="RestoreLog"/>
        </Target>
        <Target Name="Clean">   
            <Message Text="Clean project:" />
            <MSBuild Projects="$(ProjLocation)/YourProject.csproj" Properties="Configuration=Release" Targets="Clean"/>
        </Target>       
    </Project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 268k
  • Answers 268k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your friend is -(void)awakeFromNib http://www.cocoadev.com/index.pl?AwakeFromNib May 13, 2026 at 1:08 pm
  • Editorial Team
    Editorial Team added an answer Your sample code will work as long as you include… May 13, 2026 at 1:08 pm
  • Editorial Team
    Editorial Team added an answer As far as I know, whether it runs in or… May 13, 2026 at 1:08 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.