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

  • SEARCH
  • Home
  • 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

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.