Visual Studio 2012 Web Publish doesn't copy files Visual Studio 2012 Web Publish doesn't copy files asp.net asp.net

Visual Studio 2012 Web Publish doesn't copy files


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


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


To take this a bit further. You have two files that are created when you create a publish profile.

  • NewProfile.pubxml
  • NewProfile.pubxml.user

When you open a project that has these files in the PublishProfile folder from a source control it only has the .pubxml file and not the .publxml.user file, so it creates the .publxml.user file on the fly when you open the project.When it creates the new .publxml.user on the fly the xml looks like:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>

When you create a new profile it creates xml that looks like:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <PropertyGroup>    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>    <LastUsedPlatform>Any CPU</LastUsedPlatform>    <TimeStampOfAssociatedLegacyPublishXmlFile />    <EncryptedPassword />  </PropertyGroup></Project>

If you take the <PropertyGroup> node and put it in the .pubxml.user file your PublishProfiles will start working again.