Cannot publish because a project failed to build

Visual Studio 2010 has an interesting problem with ClickOnce – I couldn’t publish my application.

I got this error message when trying to publish:

Cannot publish because a project failed to build

I thought this had worked before. I found the answer here on StackOverflow.

Apparantly, the answer is that you need to use the right-click option, and not the project page option:



Well, that’s good to remember.


  1. RDRush says:

    That’s cool that an answer was available and made so by someone considerate of others’ needs when addressing such an issue. It, however, sucks that a “logical work-around” of this nature is required to publish an application as it appears that VS2K10 is sporting a broken feature — quite disappointing in my opinion as I would expect a little more from Microsoft.

    Quantity over Quality is noone’s best friend. It costs more in the long run and the impact of overrun in the long term is far more destructive and discreditable.

  2. Adam Cogan says:

    Nice blog post. It would be even better if you added the relevant connect link and told people to vote for it


  3. Bart says:

    I have been trying to figure this out for a few months. The funniest thing is i had given up on even trying to figure it out. Searched for ClickOnce Sucks on google and got brought here via the code project result from google.

  4. Lee Barker says:


    I’m using VS 2008 and tried the above but I get the “Project failed to build” original problem. I know you’re addressing a VS 2010 issue, but is VS 2008 completely broken?