Visual Studio 2012 Web Deploy publish preview shows all files as changed

1.7k Views Asked by At

The Preview pane of the Web Publishing dialog in Visual Studio 2012 works quite nicely when you're the only developer working on the codebase (see example below): enter image description here

However, it seems to fall down when multiple developers use it. It appears to use file timestamps as the means of comparsion, so even if you've gotten latest from TFS, your timestamp is different than the file the other guy published on the server, so it includes a lot of phantom changes in the list (once you drill in, the two panes of the diff are the same).

Has anyone come up with a workaround for this scenario?

2

There are 2 best solutions below

1
On

Late answer that might be useful for those using newer Visual Studio versions (2013 or later). Specify that checksum of files should be used instead of timestamp:

1) Open publishing profile xml file: \<web project>\Properties\PublishProfiles\<publishprofile>.pubxml

2) Add <MSDeployUseChecksum>true</MSDeployUseChecksum> within the property group. Final result should look like the following:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>

    <MSDeployUseChecksum>true</MSDeployUseChecksum>

    <!-- other configuration here -->
  </PropertyGroup>
  <ItemGroup>
    <MSDeployParameterValue Include="$(DeployParameterPrefix)MdwAutomaticTestingModels-Web.config Connection String">
      <UpdateDestWebConfig>False</UpdateDestWebConfig>
    </MSDeployParameterValue>
  </ItemGroup>
</Project>

More details can be found here.

2
On

So far, no. I've noticed the same problem with Team Foundation Server and publishing via file system. The problem stems from the XML files TFS is using to keep track of what was last published for a given profile. These files exist under the Project\Properties\Publish Profiles folder. The files are automatically added to the project and are next to impossible to keep out of TFS. When a team member notices that what they publish doesn't necessarily match up with what is on their machine, they delete and recreate a new publishing profile. Completely not a scalable solution, but if you google visual studio publish not working, you'll come across loads of people with the same problem.