I have updated an Excel add-in that used to work fine apart from some new requirements. I've added the new functionality, tested it and all is well so now I need to publish it. When I hit the publish button in Visual Studio 2010, I get the error, "Cannot publish because a project failed to build". However, the project is building perfectly.
How can I get the the bottom of 开发者_如何学Gothis problem and publish my updated add-in?
What are the build errors appearing after you attempt to publish it? Building your add-in for debugging in the test environment is different from the build that takes place before publishing. Such errors are usually higher level (problem with your project configuration, not your code), but it shouldn't be hard to figure out what they are if you review the build log.
Check your output tab and not just your error tab. The output tab will give you more detailed information on what is failing.
The following issue occurred to me, when I tried to build/publish an Add-In on a machine where it was installed previously by hand (e.g. from a previous setup.exe), that I received a message telling me that the customization could not be loaded.
If the publishing fails, check the writing-rights on the harddisc, create a new signing-key and add it to the project and clean your target directory, where you publish.
Eventually publish to a local temp-directory to make sure, that writing is possible. And finally clean your solution - sometimes this helps.
精彩评论