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 574215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:48:26+00:00 2026-05-13T13:48:26+00:00

I have Windows application in csproj in my solution, and I want generate Publish

  • 0

I have Windows application in csproj in my solution, and I want generate Publish using command line (bat, cmd).

My script is (I put \r\n for better reading):

 SET MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe"
    SET CARWIN="..\..\Security.CarWin.csproj"

    rem msbuild para publish

    %MSBUILD% /target:rebuild;publish %CARWIN% 
/p:ApplicationVersion="1.0.0.0" 
/p:Configuration=release 
/p:PublishUrl="C:\ClickOnce\CarWin.WebInstall\Publicacion\" 
/p:InstallUrl="http://desserver/carwinclickonce/Publicacion/" 
/p:PublishDir="C:\ClickOnce\CarWin.WebInstall\Publicacion\" 

note: I’ll try too using /target:publish

But in path PublishDir or PublishUrl (C:\ClickOnce\CarWin.WebInstall\Publicacion) not generates any files.

I have seen many posts in this site and google but I not found any solution.

  • 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-13T13:48:26+00:00Added an answer on May 13, 2026 at 1:48 pm

    Take a look at this Stack Overflow question. Basically the PublishUrl property is ignored when running ClickOnce from the command line. But you can easily add the behaviour with an additional MSBuild-task.

    I’ve created an additional MSBuild-File, for example a build.csproj. This contains a publish-task. This task first invokes the regular MS-Build of the target-project. Afterwards it copies the result to the publish-directory. Now I invoke the ‘build.csproj’ instead of the reguar project-file from the command-line:

        <?xml version="1.0" encoding="utf-8"?>
        <Project ToolsVersion="3.5" DefaultTargets="Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
          <PropertyGroup>
            <!-- project name-->
            <ProjectName>MyExampleProject</ProjectName> 
            <!--properties for the project-build-->
            <DefaultBuildProperties>Configuration=Release</DefaultBuildProperties> 
            <!-- location of the click-once stuff, relative to the project -->
            <ProjectPublishLocation>.\bin\Release\app.publish</ProjectPublishLocation> 
            <!-- Location you want to copy the click-once-deployment. Here an windows-share-->
            <ProjectClickOnceFolder>\\TargetServer\deployments</ProjectClickOnceFolder> 
          </PropertyGroup>
          <Target Name="Publish" DependsOnTargets="Clean">
            <Message Text="Publish-Build started for build no $(ApplicationRevision)" />
            <!-- run the original build of the project -->
            <MSBuild Projects="./$(ProjectName).csproj"
            Properties="$(DefaultBuildProperties)"
            Targets="Publish"/>
            <!-- define the files required for click-once-->
            <ItemGroup>
              <SetupFiles Include="$(ProjectPublishLocation)\*.*"/>
              <UpdateFiles Include="$(ProjectPublishLocation)\Application Files\**\*.*"/>
            </ItemGroup>
            <!-- and copy them -->
            <Copy
            SourceFiles="@(SetupFiles)"
            DestinationFolder="$(ProjectClickOnceFolder)\"/>
            <Copy
            SourceFiles="@(UpdateFiles)"
            DestinationFolder="$(ProjectClickOnceFolder)\Application Files\%(RecursiveDir)"/>
          </Target>
          <Target Name="Clean">
            <Message Text="Clean project" />
            <MSBuild Projects="./$(ProjectName).csproj"
            Properties="$(DefaultBuildProperties)"
            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 Windows Application that is accepting a string via command line parameter.
I have a Windows application written in C# using winforms. I want to make
I have windows forms application with multiple forms and controls in them. I want
I have a Windows application that exports to Excel using the Excel Object Module
I have a windows application in visual C++. I am not using MFC, in
I have windows application build using Visual C++. Its being build and run on
I have to develop Windows C# application, using Visual Studio 2008. It have dynamical
I have windows form application written in VC ++ . I want to change
I have a Windows application created using QT. My icon in the top left
I have a windows application working with a SQL Compact 4.0 database, using EF

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.