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.