ClickOnce - Cannot publish because a project failed to build

后端 未结 11 1424
你的背包
你的背包 2020-12-14 07:10

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

相关标签:
11条回答
  • 2020-12-14 07:47

    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.

    0 讨论(0)
  • 2020-12-14 07:51

    If nothing else works, try this :

    1. Set your date to the proper date.
    2. With VS closed, delete all the bin and obj folders of your solution.
    3. Create a new empty solution.
    4. Add your existing projects to the solution.
    5. Add back the needed references.
    6. Rebuild to make sure you didn't miss anything.
    7. Publish.

    If you want, you can also just try step 1, 2, 6, 7 before, if you don't feel like making a new solution.

    0 讨论(0)
  • 2020-12-14 07:54

    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.

    0 讨论(0)
  • 2020-12-14 07:57

    With the date back to normal, close VS and try deleting your *.suo files next to the *.sln files and then reopen the solution

    0 讨论(0)
  • 2020-12-14 08:03

    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

    0 讨论(0)
  • 2020-12-14 08:03

    Just create a new ClickOnce manifest certificate, and it will work again.

    0 讨论(0)
提交回复
热议问题