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

2

9

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?

Carse answered 14/8, 2013 at 15:34 Comment(0)
M
11

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.

Messidor answered 19/1, 2017 at 13:34 Comment(1)
Thanks @Alexei, your solution really works. It should be marked as an answer so others will get benefit from it. I voted up.Barger
D
2

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.

Derina answered 4/3, 2014 at 16:20 Comment(2)
Interesting. Since I posted this, I explored the file system publishing option, and it seems to be more intelligent in this regard. It ignores the server timestamp completely; instead, it compares the timestamp in the .pubxml.user file w/ the file's current timestamp, publishing if the file is newer. It seems YMMV on this issue.Carse
I added this idea to Visual Studio's User Voice: Improve support for multiple users using Web Deploy Publish Preview. Go vote!Availability

© 2022 - 2024 — McMap. All rights reserved.