该请求的性能计数器不是自定义计数器,它必须初始化为只读"。上RouteTable.Routes.MapHubs(); [英] The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly." on RouteTable.Routes.MapHubs();

查看:1931
本文介绍了该请求的性能计数器不是自定义计数器,它必须初始化为只读"。上RouteTable.Routes.MapHubs();的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与SignalR版本1.1.2和温莎城堡在ASPNET MVC 4应用程序的工作。
我的问题是,这个错误信息显示出来,因为我搬到了新SignalR版本。

I'm working with SignalR 1.1.2 version and Windsor Castle in an AspNet MVC 4 application. My problem is that this error message is showing up since I moved to the newer SignalR version.

"The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly."

在该行

    RouteTable.Routes.MapHubs();

这是RegisterHubs类

public static class RegisterHubs
{
    public static void Start()
    {
        var signalrDependencyContainer = new WindsorContainer().Install(new HubsInstaller());
        var signalrDependency = new SignalrDependencyResolver(signalrDependencyContainer.Kernel);
        GlobalHost.DependencyResolver = signalrDependency;
        RouteTable.Routes.MapHubs();
    }
}

我已经尝试了一些东西,我在互联网上找到,如:

I already tried a few things I've found in internet like:

lodctr /R
cd C:\Windows\Inf\.NETFramework
lodctr corperfmonsymbols.ini

但我仍然得到同样的错误消息。有任何想法吗?

But I'm still getting the same error message. Any ideas?

我用的dotnet框架4.5。

I'm using dotnet framework 4.5.

这是堆栈跟踪

at System.Diagnostics.PerformanceCounter.InitializeImpl()

谢谢!

更新
我添加德鲁要求的截图。

UPDATE I'm adding the screenshots requested by Drew.

推荐答案

所以根据您所提供的信息很明显,这些都是第一次机会异常时SignalR试图创建性能计数器,但不会被抛出有权与该过程下运行的身份这样做。您可以放心地忽略这些例外,但你显然不会得到性能计数器数据。

So based on the information you've provided it is clear that these are first chance exceptions being thrown when SignalR is attempting to create the performance counters but doesn't have the rights to do so with the identity that the process is running under. You can safely ignore these exceptions, but you obviously won't get performance counter data.

如果你想创建你需要确保当它运行你的应用程序的标识属于性能计数器用户组的性能计数器。如果不是这样,你需要使用微软ASP.NET SignalR公用事业的NuGet包<提供的实用应用程序/ A>,允许你创建计数器带外。只要安装包,然后运行命令:

If you want to create the performance counters you need to make sure the identity of your application belongs to the Performance Counter Users group when it's running. Either that or you need to use the utility application provided in the Microsoft ASP.NET SignalR Utilities NuGet package that allows you to create the counters out of band. Just install the package and run the command:

signalr ipc

这篇关于该请求的性能计数器不是自定义计数器,它必须初始化为只读&QUOT;。上RouteTable.Routes.MapHubs();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆