[英]ASP.NET Performance Counter value
I am building a library project that will record the values of ASP.NET Performance Counters when used with a ASP.NET Project. 我正在构建一个库项目,当与ASP.NET项目一起使用时,它将记录ASP.NET性能计数器的值。 But when I try to run the following code -
但是当我尝试运行以下代码时-
var _RequestsPerSecond = new PerformanceCounter("ASP.NET Applications", "Requests/sec", Process.GetCurrentProcess().ProcessName);
_RequestsInApplicationQueueValue = _RequestsInApplicationQueue.NextValue();
It gives me the error iis express does not exist in this category. 它给我的错误iis express在这个类别中不存在。 Any suggestions.?
有什么建议么。?
将Process.GetCurrentProcess()。ProcessName替换为System.Web.Hosting.HostingEnvironment.ApplicationID.Replace('/','_')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.