Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 651
Evan Haas Avatar asked Aug 14 '13 15:08

Evan Haas


People also ask

How do I publish a Web application in Visual Studio 2012?

Just select the profile from the list to start the Publish directly. Once the profile name has been created, the next step is to configure the other settings through the Connection wizard. This wizard has most of the publishing settings, like various publish methods and the destination URL or path and so on.

How do I publish changes in Visual Studio?

In Solution Explorer, select the ContosoUniversity project. the Web One Click Publish toolbar, choose the Test publish profile and then click Publish Web (the icon with arrows pointing left and right). Visual Studio deploys the updated application, and the browser automatically opens to the home page.

How do I know if Microsoft Web deploy is installed?

Is Web Deploy installed? You can verify web deploy is installed by going to the "Programs and Features" control panel and looking for "Microsoft Web Deploy 2.0" in the list of installed programs. If it is not there, you can install it via the Web Platform Installer by going to the "Products" tab.

What does publishing do in Visual Studio?

Publishing creates the set of files that are needed to run your application. To deploy the files, copy them to the target machine.


1 Answers

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.

like image 59
Alexei - check Codidact Avatar answered Nov 13 '22 05:11

Alexei - check Codidact