<运行时 > 元素<runtime> Element

提供公共语言运行时用于配置应用程序的信息。Provides information used by the common language runtime to configure applications.

<configuration><configuration>
<运行时 ><runtime>

语法Syntax

<runtime>  
</runtime>  

特性和元素Attributes and Elements

以下各节描述了子元素和父元素。The following sections describe child elements and parent elements.

特性Attributes

无。None.

子元素Child Elements

元素Element 描述Description
<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.
<bypassTrustedAppStrongNames><bypassTrustedAppStrongNames> 指定是否应绕过对受信任的程序集进行强名称验证。Specifies whether strong name verification for trusted assemblies should be bypassed.
<CompatSortNLSVersion><CompatSortNLSVersion> 指定执行字符串比较时,运行时应使用旧排序行为。Specifies that the runtime should use legacy sorting behavior when performing string comparisons.
<developmentMode><developmentMode> 指定运行时是否搜索由 DEVPATH 环境变量指定的目录中的程序集。Specifies whether the runtime searches for assemblies in directories specified by the DEVPATH environment variable.
<disableCachingBindingFailures><disableCachingBindingFailures> 指定是否禁用缓存绑定故障,即.NET Framework 2.0 版中的默认行为。Specifies whether the caching of binding failures, which is the default behavior in the .NET Framework version 2.0, is disabled.
<disableCommitThreadStack><disableCommitThreadStack> 指定在线程启动时是否提交完整线程堆栈。Specifies whether the full thread stack is committed when a thread is started.
<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 common language 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.
<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.
<PreferComInsteadOfRemoting><PreferComInsteadOfRemoting> 指定运行时将使用 COM 互操作来代替跨应用程序域边界的远程。Specifies that the runtime will use COM interop instead of remoting across application domain boundaries.
<relativeBindForResources><relativeBindForResources> 优化附属程序集的探测。Optimizes the probe for satellite assemblies.
<shadowCopyVerifyByTimeStamp><shadowCopyVerifyByTimeStamp> 指定卷影复制是否使用 .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.

父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.

备注Remarks

中的子元素<运行时 >配置文件节由公共语言运行时,若要配置应用程序的执行方式。The child elements in the <runtime> section of a configuration file are used by the common language runtime to configure how an application executes. 例如, <gcServer >元素确定垃圾回收器使用工作站垃圾回收或服务器垃圾回收 <Userandomizedstringhashalgorithm,那么 >元素可确定公共语言运行时是否计算上每个程序或每个应用程序域为基础,字符串的哈希代码和AppContextSwitchOverrides元素允许库用户若要选择加入或退出更改库提供的功能。For example, the <gcServer> element determines whether the garbage collector uses workstation garbage collection or server garbage collection, the <UseRandomizedStringHashAlgorithm> element determines whether the common language runtime calculates hash codes for string on a per-application or a per-application domain basis, and the AppContextSwitchOverrides element allows library users to opt in or opt out of changed functionality provided by a library.

中的元素<运行时 >部分由公共语言运行时在应用程序启动时自动读取。The elements in the <runtime> section are read automatically by the common language runtime at application startup. 您还可以通过提供到其名称定义一个非默认应用程序域的配置文件AppDomainSetup.ConfigurationFile属性; 其设置将应用程序域加载时自动读取。You can also define the configuration file for a non-default application domain by supplying its name to the AppDomainSetup.ConfigurationFile property; its settings are read automatically when the application domain is loaded. 您应该很少,即使有的话会需要直接读取中的设置<运行时 >应用程序的配置文件中的部分。You should rarely, if ever, have a need to directly read the settings in the <runtime> section in your application's configuration file.

请参阅See also