运行时设置架构Runtime Settings Schema

运行设置由公共语言运行时用于配置面向 .NET Framework 的应用程序。Runtime settings are used by the common language runtime to configure applications that target the .NET Framework.

<运行时 > 节和其父级和子级元素The <runtime> section and its parent and child elements

<configuration><configuration>
  <runtime>  <runtime>
    <alwaysFlowImpersonationPolicy>    <alwaysFlowImpersonationPolicy>
    <AppContextSwitchOverrides>    <AppContextSwitchOverrides>
    <appDomainManagerAssembly>    <appDomainManagerAssembly>
    <appDomainManagerType>    <appDomainManagerType>
    <appDomainResourceMonitoring>    <appDomainResourceMonitoring>
    <assemblyBinding>    <assemblyBinding>
      <dependentAssembly>      <dependentAssembly>
        <assemblyIdentity>        <assemblyIdentity>
        <bindingRedirect>        <bindingRedirect>
        <codeBase>        <codeBase>
      <probing>      <probing>
      <publisherPolicy>      <publisherPolicy>
      <qualifyAssembly>      <qualifyAssembly>
    <bypassTrustedAppStrongNames>    <bypassTrustedAppStrongNames>
    <CompatSortNLSVersion>    <CompatSortNLSVersion>
    <developmentMode>    <developmentMode>
    <disableCachingBindingFailures>    <disableCachingBindingFailures>
    <disableCommitThreadStack>    <disableCommitThreadStack>
    <disableFusionUpdatesFromADManager>    <disableFusionUpdatesFromADManager>
    <EnableAmPmParseAdjustment>    <EnableAmPmParseAdjustment>
    <enforceFIPSPolicy>    <enforceFIPSPolicy>
    <etwEnable>    <etwEnable>
    <forcePerformanceCounterUniqueSharedMemoryReads>    <forcePerformanceCounterUniqueSharedMemoryReads>
    <gcAllowVeryLargeObjects>    <gcAllowVeryLargeObjects>
    <gcConcurrent>    <gcConcurrent>
    <GCCpuGroup>    <GCCpuGroup>
    <gcServer>    <gcServer>
    <generatePublisherEvidence>    <generatePublisherEvidence>
    <legacyCorruptedStateExceptionsPolicy>    <legacyCorruptedStateExceptionsPolicy>
    <legacyImpersonationPolicy>    <legacyImpersonationPolicy>
    <loadfromRemoteSources>    <loadfromRemoteSources>
    <NetFx40_LegacySecurityPolicy>    <NetFx40_LegacySecurityPolicy>
    <NetFx40_PInvokeStackResilience>    <NetFx40_PInvokeStackResilience>
    <NetFx45_CultureAwareComparerGetHashCode_LongStrings>    <NetFx45_CultureAwareComparerGetHashCode_LongStrings>
    <PreferComInsteadOfManagedRemoting>    <PreferComInsteadOfManagedRemoting>
    <relativeBindForResources>    <relativeBindForResources>
    <shadowCopyVerifyByTimeStamp>    <shadowCopyVerifyByTimeStamp>
    <supportPortability>    <supportPortability>
    <system.runtime.caching>    <system.runtime.caching>
      <memoryCache>      <memoryCache>
        <namedCaches>        <namedCaches>
          <add>          <add>
          <clear>          <clear>
          <remove>          <remove>
    <Thread_UseAllCpuGroups>    <Thread_UseAllCpuGroups>
    <ThrowUnobservedTaskExceptions>    <ThrowUnobservedTaskExceptions>
    <TimeSpan_LegacyFormatMode>    <TimeSpan_LegacyFormatMode>
    <useLegacyJit>    <useLegacyJit>
    <UseRandomizedStringHashAlgorithm>    <UseRandomizedStringHashAlgorithm>
    <UseSmallInternalThreadStacks>    <UseSmallInternalThreadStacks>
  <\runtime>  <\runtime>
<\configuration><\configuration>

按字母顺序列出的<运行库 > 元素Alphabetical list of <runtime> elements

元素Element 描述Description
<add><add> 向内存缓存的 namedCaches 集合添加一个命名的缓存。Adds a named cache to the namedCaches collection for a memory cache.
<alwaysFlowImpersonationPolicy><alwaysFlowImpersonationPolicy> 指定 Windows 标识始终流经异步点,而不考虑执行模拟的方式。Specifies that the Windows identity always flows across asynchronous points, regardless of how impersonation was performed.
<AppContextSwitchOverrides><AppContextSwitchOverrides> 定义 AppContext 类使用的一个或多个开关,用于提供新功能的选择退出机制。Defines one or more switches used by the AppContext class to provide an opt-out mechanism for new functionality.
<appDomainManagerAssembly><appDomainManagerAssembly> 指定为过程中的默认应用程序域提供应用程序域管理器的程序集。Specifies the assembly that provides the application domain manager for the default application domain in the process.
<appDomainManagerType><appDomainManagerType> 指定用作默认应用程序域的应用程序域管理器的类型。Specifies the type that serves as the application domain manager for the default application domain.
<appDomainResourceMonitoring><appDomainResourceMonitoring> 指示运行时在过程的生命周期过程中收集所有应用程序域的统计数据。Instructs the runtime to collect statistics on all application domains in the process for the life of the process.
<assemblyBinding><assemblyBinding> 包含有关程序集版本重定向和程序集位置的信息。Contains information about assembly version redirection and the locations of assemblies.
<assemblyIdentity><assemblyIdentity> 包含有关程序集的标识信息。Contains identifying information about an assembly.
<bindingRedirect><bindingRedirect> 将一个程序集版本重定向到另一个版本。Redirects one assembly version to another.
<bypassTrustedAppStrongNames><bypassTrustedAppStrongNames> 指定是否应绕过对受信任的程序集进行强名称验证。Specifies whether strong name verification for trusted assemblies should be bypassed.
<clear><clear> 清除内存缓存的 namedCaches 集合。Clears the namedCaches collection for a memory cache.
<codeBase><codeBase> 指定运行时可以找到程序集的位置。Specifies where the runtime can find an assembly.
<CompatSortNLSVersion><CompatSortNLSVersion> 指定在执行字符串比较时,运行时应使用旧排序行为Specifies that the runtime should use legacy sorting behavior when performing string comparisons
<dependentAssembly><dependentAssembly> 封装每个程序集的绑定策略和程序集位置。Encapsulates binding policy and assembly location for each assembly.
<developmentMode><developmentMode> 指定运行时是否搜索由 DEVPATH 环境变量指定的目录中的程序集。Specifies whether the runtime searches for assemblies in directories specified by the DEVPATH environment variable.
<disableCachingBindingFailures><disableCachingBindingFailures> 指定是否禁用 .NET Framework 2.0.NET Framework 2.0 中缓存绑定失败的默认行为。Specifies whether the caching of binding failures, which is the default behavior in the .NET Framework 2.0.NET Framework 2.0, is disabled.
<disableCommitThreadStack><disableCommitThreadStack> 指定在线程启动时是否提交完整线程堆栈。Specifies whether the full thread stack is committed when a thread starts.
<disableFusionUpdatesFromADManager><disableFusionUpdatesFromADManager> 指定是否禁用允许运行时主机为应用程序域重写配置设置的默认行为。Specifies whether the default behavior, which is to allow the runtime host to override configuration settings for an application domain, is disabled.
<EnableAmPmParseAdjustment><EnableAmPmParseAdjustment> 确定日期和时间分析方法是否使用调整后的一组规则来分析仅包含天、月、小时和 AM/PM 指示符的日期字符串。Determines whether date and time parsing methods use an adjusted set of rules to parse date strings that contain only a day, month, hour, and AM/PM designator.
<enforceFIPSPolicy><enforceFIPSPolicy> 指定是否强制执行以下计算机配置要求:加密算法必须符合美国联邦信息处理标准 (FIPS)。Specifies whether to enforce a computer configuration requirement that cryptographic algorithms must comply with the Federal Information Processing Standards (FIPS).
<etwEnable><etwEnable> 指定是否为公共语言运行时事件启用 Windows 事件跟踪 (ETW)。Specifies whether to enable event tracing for Windows (ETW) for common language runtime events.
<forcePerformanceCounterUniqueSharedMemoryReads><forcePerformanceCounterUniqueSharedMemoryReads> 指定 PerfCounter.dll 是否使用 .NET Framework 版本 1.1 应用程序中的 CategoryOptions 注册表设置,以确定是否加载来自特定于类别的共享内存或全局内存的性能计数器数据。Specifies whether PerfCounter.dll uses the CategoryOptions registry setting in a .NET Framework version 1.1 application to determine whether to load performance counter data from category-specific shared memory or global memory.
<gcAllowVeryLargeObjects><gcAllowVeryLargeObjects> 在 64 位平台上,启用总大小大于 2 千兆字节 (GB) 的数组。On 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size.
<gcConcurrent><gcConcurrent> 指定运行时是否并发运行服务器垃圾回收。Specifies whether the runtime runs garbage collection concurrently.
<GCCpuGroup><GCCpuGroup> 指定垃圾回收是否支持多个 CPU 组。Specifies whether garbage collection supports multiple CPU groups.
<gcServer><gcServer> 指定公共语言运行时是否运行服务器垃圾回收。Specifies whether the common language runtime runs server garbage collection.
<generatePublisherEvidence><generatePublisherEvidence> 指定运行时是否使用代码访问安全性 (CAS) 发布服务器策略。Specifies whether the runtime uses code access security (CAS) publisher policy.
<legacyCorruptedStateExceptionsPolicy><legacyCorruptedStateExceptionsPolicy> 指定运行时是否允许托管的代码捕获访问冲突和其他损坏状态异常。Specifies whether the runtime allows managed code to catch access violations and other corrupted state exceptions.
<legacyImpersonationPolicy><legacyImpersonationPolicy> 指定 Windows 标识不流经异步点,而不考虑当前线程上执行上下文的流设置。Specifies that the Windows identity does not flow across asynchronous points, regardless of the flow settings for the execution context on the current thread.
<loadfromRemoteSources><loadfromRemoteSources> 指定是否将来自远程源的程序集加载为完全信任。Specifies whether assemblies from remote sources are loaded as full trust.
<memoryCache><memoryCache> 定义一个用于配置基于 MemoryCache 类的缓存的元素。Defines an element that is used to configure a cache that is based on the MemoryCache class.
<namedCaches><namedCaches> 包含 namedCache 实例的配置设置的集合。Contains a collection of configuration settings for the namedCache instance.
<NetFx40_LegacySecurityPolicy><NetFx40_LegacySecurityPolicy> 指定运行时是否使用旧版代码访问安全性 (CAS) 策略。Specifies whether the runtime uses legacy code access security (CAS) policy.
<NetFx40_PInvokeStackResilience><NetFx40_PInvokeStackResilience> 指定运行时是否以减慢托管和非托管代码之间的转换速度为代价,在运行时自动修复不正确的平台调用声明。Specifies whether the runtime automatically fixes incorrect platform invoke declarations at run time, at the cost of slower transitions between managed and unmanaged code.
<NetFx45_CultureAwareComparerGetHashCode_LongStrings><NetFx45_CultureAwareComparerGetHashCode_LongStrings> 指定运行时是否使用固定的内存量来计算 StringComparer.GetHashCode 方法的哈希代码。Specifies whether the runtime uses a fixed amount of memory to calculate hash codes for the StringComparer.GetHashCode method.
<PreferComInsteadOfManagedRemoting><PreferComInsteadOfManagedRemoting> 指定运行时将使用 COM 互操作来代替跨应用程序域边界的远程。Specifies that the runtime will use COM interop instead of remoting across application domain boundaries.
<probing><probing> 指定加载程序集时运行时搜索的子目录。Specifies subdirectories that the runtime searches when loading assemblies.
<publisherPolicy><publisherPolicy> 指定运行时是否使用发布者策略。Specifies whether the runtime applies publisher policy.
<qualifyAssembly><qualifyAssembly> 指定使用部分名称时应动态加载的程序集全名。Specifies the full name of the assembly that should be dynamically loaded when a partial name is used.
<relativeBindForResources><relativeBindForResources> 优化附属程序集的探测。Optimizes the probe for satellite assemblies.
<remove><remove> 从内存缓存的 namedCaches 集合中删除一个命名的缓存条目。Removes a named cache entry from the namedCaches collection for a memory cache.
<runtime><runtime> 包含有关程序集绑定和垃圾回收行为的信息。Contains information about assembly binding and the behavior of garbage collection.
<shadowCopyTimeStampVerification><shadowCopyTimeStampVerification> 指定卷影复制是否使用 .NET Framework 4.NET Framework 4 中引入的默认启动行为,或恢复到 .NET Framework 的早期版本的启动行为。Specifies whether shadow copying uses the default startup behavior introduced in the .NET Framework 4.NET Framework 4, or reverts to the startup behavior of earlier versions of the .NET Framework.
<supportPortability><supportPortability> 通过禁用将程序集视为等效于应用程序可移植性用途的默认行为来指定应用程序可以在两种不同的 .NET Framework 实现中引用同一程序集。Specifies that an application can reference the same assembly in two different implementations of the .NET Framework, by disabling the default behavior that treats the assemblies as equivalent for application portability purposes.
<system.runtime.caching><system.runtime.caching> 提供默认内存中对象缓存的配置信息。Provides configuration information for the default in-memory object cache.
<Thread_UseAllCpuGroups><Thread_UseAllCpuGroups> 指定运行时是否跨所有 CPU 组分发托管的线程。Specifies whether the runtime distributes managed threads across all CPU groups.
<ThrowUnobservedTaskExceptions><ThrowUnobservedTaskExceptions> 指定未经处理的任务异常是否应终止正在运行的进程。Specifies whether unhandled task exceptions should terminate a running process.
<TimeSpan_LegacyFormatMode><TimeSpan_LegacyFormatMode> 指定运行时是否使用 TimeSpan 值的旧格式。Specifies whether the runtime uses legacy formatting for TimeSpan values.
<useLegacyJit><useLegacyJit> 确定公共语言运行时是否使用实时编译的旧版 64 位 JIT 编译器。Determines whether the common language runtime uses the legacy 64-bit JIT compiler for just-in-time compilation.
<UseRandomizedStringHashAlgorithm><UseRandomizedStringHashAlgorithm> 指定运行时是否按应用程序域计算字符串的哈希代码。Specifies whether the runtime calculates hash codes for strings on a per application domain basis.
<UseSmallInternalThreadStacks><UseSmallInternalThreadStacks> 请求运行时在创建内部使用的某些线程时使用显式堆栈大小,而不是默认堆栈大小。Requests that the runtime use explicit stack sizes when it creates certain threads that it uses internally, instead of the default stack size.

请参阅See also