The document is archived and information here might be outdated
Cannot publish because a project failed to build
Whenever you publish a project, Visual Studio first builds it. This fatal error occurs when the build process failed, preventing the publish process from occurring.
To correct this error
Examine and address the build errors before attempting to publish again.