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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:29:25+00:00 2026-05-17T18:29:25+00:00

In Visual Studio 2008, can a post-build event be used with ClickOnce publishing? If

  • 0

In Visual Studio 2008, can a post-build event be used with ClickOnce publishing? If so, how?

Out of the box, it looks like I can only use pre-build events and ClickOnce publishing seems to build the project to a different location, before the post build event is launched.

  • 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-17T18:29:26+00:00Added an answer on May 17, 2026 at 6:29 pm

    Looking at the MSBuild files Visual Studio uses, the post build event is run by the Build target. If you run msbuild from the command-line and call the Publish target directly, it definitely calls Build first. If you right-click on the project in VS and click Publish, a trimmed-down target called PublishOnly gets run, on the assumption that VS has already done a build.

    Your post build event should be run by Visual Studio when it automatically builds your project prior to publishing. In the Build Events tab of your project’s properties, did you set the event to “run always”?

    If you want to be more explicit about what happens prior to publishing, there’s a BeforePublish target that Publish always looks for, whether it’s run by MSBuild or Visual Studio. Edit your project file by hand, and at the bottom you’ll see a couple of commented-out Target elements. Add one of your own like this:

    <Target Name="BeforePublish">
        <Exec Condition="'$(PostBuildEvent)' != ''" 
              WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
    </Target>
    

    That will run the same post build event you defined in your project, but you could put any MSBuild tasks inside those Target elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio (2008) is it possible to force the Post-Build Event for a
I have two questions re: visual studio 2008 and post-build events. 1) How do
I used to use discountasp.net and I can use Visual Studio 2008 to publish
Can Report Viewer 2010 control be used in Visual studio 2008 (ASP.NET apps) without
I know in Visual Studio 2008 you can target a specific framework with your
Can Visual Studio 2008 be configured to give me a warning when I forget
I currently use visual studio 2008 for creating projects that can run on windows.
In Visual Studio 2008 project properties, Application tab, I can set the Output type
Can you have two tables in Visual studio 2008 report (in the report control)
How can I install LINQ in my Visual Studio 2008?

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.