Domanda

I've encountered this issue several times, every time I change a dev machine, did a minor change, it re-publish everything even including images (jpg, png, gif), and the comparison windows shows no difference at all.

The "solution" is re-publish everything, then on this machine it will work correctly, however, once I change to another machine, same issue happen. I can't stand it any more...

È stato utile?

Soluzione

This happens because by default Web Deploy uses file modification dates to check if the file needs to be copied to target. When you change dev pc you re-buiold everything effectively setting file modification timestamps to a newever date, than it was when publishing from old dev machine.

As of the new ASP.NET and Web Tools for Visual Studio 2013 Release you can configure your web peoject to use checksums instead of modification timestamps. This must solve your problem. - see http://msdn.microsoft.com/en-us/library/ee942158.aspx#use_checksum

Just modify your publich profile to include the following:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <MSDeployUseChecksum>true</MSDeployUseChecksum>
    <!— other settings omitted to keep the example short -->
    <PublishDatabaseSettings>
      <!— this section omitted to keep the example short -->
    </PublishDatabaseSettings>
  </PropertyGroup>
</Project>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top