Solution 1:

Same problem. The workaround was changing the publish settings from Release to Debug. Re-publish and then change back to Release...

Solution 2:

This may be caused by solutions/projects that were created with the RC of vs2012. This happened to me months ago and fixed the problem by making sure my solution build configurations matched my project configurations...

I just recently experienced the same problem when opening the same solution originally created in vs2012RC with VS2012 Express for Web. I did exactly what the original poster suggested and it fixed my problem.

Here is the thread that lead me to the answer:

connect.microsoft.com/VisualStudio/feedback/details/746321/publish-web-application-fails

The pertinent response from the conversation above that helped me was:

Posted by Microsoft on 6/13/2012 at 12:00 PM Hi Andrew,

This was a bug in how we handle the solution configuration vs. the project configuration. We incorrectly assumed that they would be the same (e.g. Solution's Release|x86 would have each project set to Release|x86 as well), which caused us to use the wrong build properties for publishing files.

The workaround is to make the solution configuration and build configuration match. This issue will be fixed in the next release of Visual Studio 2012.

Thanks, - Jimmy Lewis SDET, Visual Web Developer team