Rajko Rajko - 1 year ago 150
C# Question

ClickOnce - Cannot publish because a project failed to build

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\MyAPP.exe'

I get these errors no matter where from I publish: publish wizard, build menu or right click on project - publish.

First it was working ok, but I did the following:

I changed the date om my computer to 10/10/2013, I was trying something else.
I forgot this and I click build. Then I set the proper date on computer. After that I get these errors.

Also every time I click run Visual Studio builds project whether there are changes in project.

I also noticed that when I set the date after 10/10/2013 it works ok.

I am guessing that I am looking for some settings in my project where this date of build is set.

I tried build, rebuild, clean solution.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download