Ok, if you see this error "Cannot publish because a project failed to build" and your project just refuses to publish, DONT PANIC!!
1.Go to your certificate key in your Solution explorer.
2. Delete it.
3. Go to Project properties -> Signing
4. Create a test certificate
5. Then publish.
Voila.... the project is published with an executable ready to be installed!