当您是唯一在代码库上工作的开发人员时,Visual Studio 2012中“Web发布”对话框的“预览” Pane 会很好地工作(请参见下面的示例):
但是,当多个开发人员使用它时,它似乎会下降。它似乎使用文件时间戳作为比较手段,因此,即使您是从TFS获得最新信息的,您的时间戳也与服务器上其他人发布的文件不同,因此列表中包含许多幻像更改(钻取后,差异的两个 Pane 是相同的)。
有人针对这种情况提出解决方法吗?
最佳答案
对于使用较新版本Visual Studio(2013或更高版本)的用户而言,最新答案可能有用。指定应使用文件的校验和代替时间戳:
1)打开发布配置文件xml文件:\<web project>\Properties\PublishProfiles\<publishprofile>.pubxml
2)在属性组中添加<MSDeployUseChecksum>true</MSDeployUseChecksum>
。最终结果应如下所示:
<?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>
可以在here中找到更多详细信息。
关于visual-studio-2012 - Visual Studio 2012 Web Deploy发布预览显示更改后的所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18236080/