简体   繁体   English

为什么总是使用Web Deployment对Web.config进行审核

[英]Why is web.config always udated using web deploy

Im using Visual Studio 2012 and Web Deploy to upload files to a web site. 我使用Visual Studio 2012和Web Deploy将文件上传到网站。

When I 'Start Preview' in 'Edit Publish Profiles' I always get Web.Config in the list of files that need uploading. 当我在“编辑发布配置文件”中“开始预览”时,我总是在需要上传的文件列表中获得Web.Config。

Why is this when web.config has not been changed on my dev PC or on the site? 当未在我的开发PC或站点上更改web.config时,为什么会这样?

Note : Im not using we.config transformations in this instance. 注意:在此实例中,我未使用we.config转换。

My guess is that the web.config transform process updates the last modified date of the files regardless of whether you declare transforms . 我的猜测是, 无论是否声明转换 ,web.config转换过程都会更新文件的最后修改日期。 Since MSDeploy defaults to using last modified as a comparison for performing updates, the file is updated each time. 由于MSDeploy默认使用上次修改的时间作为执行更新的比较,因此该文件每次都会更新。

(Before you ask: you can swap to checksum based deployments if you use msdeploy.exe directly, but not if you use MSBuild) (询问之前:如果直接使用msdeploy.exe,则可以交换到基于校验和的部署,但是如果使用MSBuild,则不能交换)

Web.config is always updated because the system can't do a compare of local vs. remote due to the possibility that a transform will change the contents of the Web.config file. Web.config始终会更新,因为由于转换可能会更改Web.config文件的内容,因此系统无法进行本地与远程比较。 Even if you haven't changed anything in the default transform files or even if you delete the transform files, the system acts as though a transformation is possible. 即使您没有更改默认转换文件中的任何内容,或者即使您删除了转换文件,系统也可以进行转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM