A late answer that may be useful for those using newer versions of Visual Studio (2013 or later). Indicate that the checksum of the files should be used instead of the timestamp:
1) Open the xml file of the publication profile file: \<web project>\Properties\PublishProfiles\<publishprofile>.pubxml
2) Add <MSDeployUseChecksum>true</MSDeployUseChecksum> to the property group. The end result should look like this:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>MSDeploy</WebPublishMethod> <MSDeployUseChecksum>true</MSDeployUseChecksum> </PropertyGroup> <ItemGroup> <MSDeployParameterValue Include="$(DeployParameterPrefix)MdwAutomaticTestingModels-Web.config Connection String"> <UpdateDestWebConfig>False</UpdateDestWebConfig> </MSDeployParameterValue> </ItemGroup> </Project>
More information can be found here .
source share