<shadowCopyVerifyByTimestamp> 元素<shadowCopyVerifyByTimestamp> Element

指定卷影复制是否使用 .NET Framework 4 中引入的默认启动行为,或恢复为 .NET Framework 早期版本的启动行为。Specifies whether shadow copying uses the default startup behavior introduced in the .NET Framework 4, or reverts to the startup behavior of earlier versions of the .NET Framework.

<configuration> <configuration>
    <runtime >   <runtime>
     <p >    <shadowCopyVerifyByTimestamp>

语法Syntax

<shadowCopyVerifyByTimestamp enabled="true|false" />  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

特性Attribute 描述Description
enabledenabled 必需的特性。Required attribute.

指定在启动时,使用卷影复制的应用程序域是否对程序集时间戳进行比较,以确定在卷影复制程序集之前是否更新了程序集。Specifies whether application domains that use shadow copying compare assembly time stamps when starting up, to determine whether an assembly has been updated before shadow copying the assembly.

enabled 特性enabled Attribute

“值”Value 描述Description
truetrue 在启动时,仅复制自上次复制到卷影复制目录以来已更新的程序集。At startup, copies only assemblies that have been updated since they were last copied to the shadow copy directory. 这是 .NET Framework 4 的默认值。This is the default for the .NET Framework 4.
Falsefalse 恢复到 .NET Framework 以前版本的启动行为,该行为是在启动时复制所有文件。Reverts to the startup behavior of previous versions of the .NET Framework, which was to copy all files at startup.

子元素Child Elements

无。None.

父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.

备注Remarks

从 .NET Framework 4 开始,仅当程序集的时间戳指示它们自上次复制到卷影复制目录后发生了更改时,才会对程序集进行卷影复制。Starting with the .NET Framework 4, assemblies are shadow copied only if their time stamps indicate that they have changed since they were last copied to the shadow copy directory. 这会缩短使用卷影复制的许多应用程序的启动时间,如卷影复制程序集中所述。This improves startup times for many applications that use shadow copying, as described in Shadow Copying Assemblies. 对于程序集更新百分比和频率都很高的应用程序,可能不会从此行为改变中获益。Applications that have a high percentage and frequency of assembly updates might not benefit from this change in behavior. 在此情况下,可以使用此元素存储 .NET Framework 早先版本的行为。In that case, you can use this element to restore the behavior of previous versions of the .NET Framework.

示例Example

下面的示例演示如何在 .NET Framework 4 中禁用卷影复制的默认启动行为,并还原为以前版本的 .NET Framework 的启动行为。The following example shows how to disable the default startup behavior of shadow copying in the .NET Framework 4, and revert to the startup behavior of previous versions of the .NET Framework.

<configuration>  
   <runtime>  
      <shadowCopyVerifyByTimestamp enabled="false" />  
   </runtime>  
</configuration>  

请参阅See also