向配置文件集合添加配置文件。
此元素是 .NET Framework 2.0 版中的新元素。
??system.web 元素(ASP.NET 设置架构)
????healthMonitoring 元素(ASP.NET 设置架构)
??????healthMonitoring 的 profiles 元素(ASP.NET 设置架构)
????????healthMonitoring 的 profiles 的 add 元素(ASP.NET 设置架构)
<add
name="profile name"
minimumInstances="minimum number of event occurrences"
maximumLimit="maximum number of event occurrences"
minimumInterval="minimum interval between events" /> |
属性和元素
下面几部分描述了本节涉及的属性、子元素和父元素。
属性
| 属性 | 说明 |
|---|---|
|
name |
必需的 String 属性。 指定配置文件名称。 |
|
minimumInstances |
必需的 Int32 属性。 指定在激发事件之前至少出现的次数。 默认值为 1。 |
|
maximumLimit |
必需的 Int32 属性。 指定阈值,在达到该值后,将停止激发事件。 默认值为 "Infinite"。 |
|
minimumInterval |
必需的 TimeSpan 属性。 指定两个事件之间的最小时间间隔,以 默认值为 "00:00:00"。 |
子元素
无。
父元素
| 元素 | 说明 |
|---|---|
|
configuration |
指定公共语言运行库和 .NET Framework 应用程序所使用的每个配置文件中的根元素。 |
|
system.web |
为 ASP.NET 配置节指定根元素。 |
|
healthMonitoring |
针对运行状况监视配置应用程序。 |
|
profiles |
定义一个参数集的集合,这些参数集可以在配置事件时使用。 |
备注
使用 add 元素可以收集在配置事件时经常使用的参数集。每个集均定义一个配置文件。
默认配置
下面的默认 add 元素在 .NET Framework 版本 2.0 的根 Web.config 文件中配置。
| ? | 复制代码 |
|---|---|
<add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom="" /> <add name="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" custom="" /> | |
示例
下面的代码示例演示如何对配置文件进行配置。
| ? | 复制代码 |
|---|---|
<healthMonitoring Enabled="true" heartBeatInterval="0">
<profiles>
<add name="Default"
minInstances="1"
maxLimit="Infinite"
minInterval="00:01:00"/>
</profiles>
</healthMonitoring> | |
元素信息
|
配置节处理程序 |
|
|
配置成员 |
|
|
可配置的位置 |
Machine.config 根级别的 Web.config 应用程序级别的 Web.config |
|
要求 |
Microsoft Internet 信息服务 (IIS) 版本 5.0、5.1 或 6.0 .NET Framework 2.0 版 Microsoft Visual Studio 2005 |
请参见
任务
参考
healthMonitoring 元素(ASP.NET 设置架构)healthMonitoring 的 profiles 元素(ASP.NET 设置架构)
healthMonitoring 的 profiles 的 remove 元素(ASP.NET 设置架构)
healthMonitoring 的 profiles 的 clear 元素(ASP.NET 设置架构)
概念
其他资源
ASP.NET 配置设置
常规配置设置 (ASP.NET)