0

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...

4

1 回答 1

2

发生这种情况是因为默认情况下 Web Deploy 使用文件修改日期来检查文件是否需要复制到目标。当您更改开发电脑时,您重新构建所有内容,有效地将文件修改时间戳设置为新日期,而不是从旧开发机器发布时。

从 Visual Studio 2013 版的新ASP.NET 和 Web 工具开始,您可以将 Web 项目配置为使用校验和而不是修改时间戳。这必须解决你的问题。- 见http://msdn.microsoft.com/en-us/library/ee942158.aspx#use_checksum

只需修改您的公开资料以包含以下内容:

<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>
于 2013-10-27T17:13:30.323 回答