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.
Examine and address the build errors before attempting to publish again.