When I try to publish my (WPF, C#) application, I get these errors:
Cannot publish because a project failed to build.
Could not find file \'obj\\x86\\Debug
I solved my problem. The problem was the "Modified" time of some files. I used the program Timestamp to fix it.
As I said in my question, the problem was that I build the solution and the date was in the future. Because of that, every time I pressed F5 Visual Studio was building the whole solution again and Publish ClickOnce wasn't working.
If nothing else works, try this :
If you want, you can also just try step 1, 2, 6, 7 before, if you don't feel like making a new solution.
I just ran into the problem today. In my particular case, it was caused by Microsoft Windows Update, Microsoft Security Advisory 2661254 (concerning minimum certificate key length).
I uninstalled that update and publish began working as it always had. This is only a temporary work around and means you should probably regenerate your keys/certificates.
With the date back to normal, close VS and try deleting your *.suo files next to the *.sln files and then reopen the solution
This is a problem with Visual Studio that can occur when you have add-ins installed. Instead of using the Publish button in the Publish tab, use Build/Publish from the menu on the top of Visual Studio.
If you use the Publish button, it runs through the add-ins before doing the build (or something like that). If you use Build from the menu instead, it goes straight to msbuild and ignores any add-ins you have installed.
If you have DevExpress installed and are still having problems, check out this article: http://www.devexpress.com/Support/Center/p/Q260132.aspx
Just create a new ClickOnce manifest certificate, and it will work again.