为什么VS2013在使用不同机器时发布所有网站文件? [英] Why does VS2013 publish all website files when using a different machine?

查看:59
本文介绍了为什么VS2013在使用不同机器时发布所有网站文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台家用机器和办公室机器,用于使用 Visual Studio 2013 发布网站.如果我在同一台机器上进行更改并重新发布,只会发布更改,而不是所有文件.

然而,当我在办公室使用我的克隆机器时,即使我做了一个最新的,做一个小的改变,然后重新发布,所有的文件都会被发布,不仅仅是那些改变的,也不仅仅是那些已经重新编译.重新发布所有 dll 文件,甚至是未更改或使用新日期重新编译的第三方 dll.如果我的同事在我上次发布后在他的机器上发布了一个小改动,也会发生同样的事情.如果从同一台机器发布两次没有问题,那么只发布更改的文件.

有没有办法阻止完全重新发布,因为发布的机器与上次发布的机器不同?谢谢.

解决方案

这似乎使确定更改"变慢了很多,但对于 .Net 4.5 [和up(?)],使用以下信息:https://msdn.microsoft.com/en-us/library/ee942158:

<块引用>

配置 Web Deploy 以使用校验和而不是日期来确定哪些文件需要复制到服务器,添加如下元素到 .pubxml 文件(发布设置):

true

像这样:

<块引用>

<属性组><MSDeployUseChecksum>true</MSDeployUseChecksum><!- 省略其他设置以保持示例简短--><发布数据库设置><!- 本节省略以保持示例简短--></发布数据库设置></PropertyGroup></项目>

I have a home machine and office machine I use to publish websites using Visual Studio 2013. If I make a change from the same machine, and re-publish, just the changes are published, not all files.

However, when using my clone machine at the office, even if I do a get latest, make one small change, and re-publish, all files are published, not just the ones that changed, and not just the ones that have been recompiled. ALL dll files, even third party dlls that have not changed or have been recompiled with a new date, are republished. Same thing happens if my cohort publishes a small change on his machine after I did the last publish. Not a problem if publishing twice from the same machine as then only the changed files are published.

Is there anyway to prevent complete republishing just because a different machine is used to publish than the one used for the last publish? Thanks.

解决方案

This seems to make "Determining Changes" a lot slower, but for .Net 4.5 [and up(?)], use this info from: https://msdn.microsoft.com/en-us/library/ee942158:

To configure Web Deploy to use checksums instead of dates to determine which files need to be copied to the server, add the following element to the .pubxml file (Publish Settings):

<MSDeployUseChecksum>true</MSDeployUseChecksum>

Like this:

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

这篇关于为什么VS2013在使用不同机器时发布所有网站文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆