locked
VS2010 - Cannot Publish because Project Failed to Build

    Question

  • I am using VS2010. I have a project that has been deployed for several years.  Project builds fine but now suddenly I get the message "Cannot publish because a project failed to build.  How can I tell what is going wrong.  This program is been updated and published hundreds of times.

    Any Ideas ?

     

    Thursday, May 20, 2010 4:39 PM

Answers

  • Tried that with same results. With the verbosity set to Diagnostic I get a lot of information.

    However I did discover that it works fine if you use the Publish Item from the Build Menu Item. It only fails when I use the publish button on the properties page.

    Thank you for your help.

     

    Friday, May 21, 2010 2:23 PM

All replies

  • Hello Cliff,

    We set the build log verbosity to Diagnostic from the menu Tools->Options->Project and Solutions->Build and Run in Visual Studio 2010.

    After that, if you build and publish your project, you can see the detailed build log from the Output window. From there, we should get futher information about why it failed to build.

     

    Best regards,

    Ji Zhou


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, May 21, 2010 9:24 AM
    Moderator
  • Tried that with same results. With the verbosity set to Diagnostic I get a lot of information.

    However I did discover that it works fine if you use the Publish Item from the Build Menu Item. It only fails when I use the publish button on the properties page.

    Thank you for your help.

     

    Friday, May 21, 2010 2:23 PM
  • Ok, I just ran into exactly the same problem! I have an application I have been publishing for 22 revisions now, and I went to publish the latest code and I got the same error message. But there are ZERO build errors for this project, and I can build and run it on my development machine just fine in release mode. However when I got to publish it, I get this same error message.

    And just like Cliffko said above, if I publish it from the 'Build' menu it works! It just does not work if I perform the publish from the application properties pages and use the publish button.

    This clearly must be some kind of bug in VS2010, as I cannot figure out at all why it works one way, but not the other?

    Friday, June 4, 2010 1:30 AM
  • I'm having the same problem. Changed the verbose settings, deleted bin & obj folders, cleaned solution. When publishing from the Application->Properties->Publish tab, I get no errors. Here's the data from my Output window:

    Building TestPublish...
    Error: Cannot publish because a project failed to build.

    However, when I right-click on the project and publish it from the context menu, it's successful.

     

    Wednesday, June 16, 2010 4:06 PM
  • Same issue here. Works great from menu, failes everytime through project page.
    Monday, June 21, 2010 6:22 PM
  • Doesn't look like we are getting any responses on this one. It is an extremely annoying bug, annoying enough for me that I am ditching Click Once for our application and plan to do my own update system. Thankfully for me, we are not deploying the code as internet apps, but simply a nice way to keep our warehousing apps up to date on our local network. So I can get rid of without too much work ....
    Thursday, June 24, 2010 7:01 PM
  • Thank you.  I probably could have spent hours on this.  Also works fine for me from the build menu or right click on project.

    Peter

    Thursday, July 22, 2010 2:36 PM
  • Same error here.  Publish from property page doesnt work any more.  Right-click Publish does.

     

    How did this not get tested?

    Thursday, July 29, 2010 3:21 PM
  • Having exactly same issue. My solution is to clean solution, close VS IDE; Reopen IDE, I can then build and publish from project properties page.  (Click on publish, it will build solution first)
    Monday, August 2, 2010 1:58 PM
  • FYI - I believe this issue is under investigation as part of Connect bug 551674. Any updates on this issue will be reported in that bug.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, August 2, 2010 10:26 PM
  • I had this issue too and figured out what it was!  Do you have Google Desktop by chance?  If you do, close the sidebar, after I closed google sidebar it published just fine!
    • Proposed as answer by derekmski Monday, November 15, 2010 2:31 AM
    Monday, November 15, 2010 2:30 AM