Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net RouteTable.Routes.MapHubs()仅在Windows Azure emulator中引发异常。为什么?_.net_Asp.net Mvc 3_Azure_Signalr - Fatal编程技术网

.net RouteTable.Routes.MapHubs()仅在Windows Azure emulator中引发异常。为什么?

.net RouteTable.Routes.MapHubs()仅在Windows Azure emulator中引发异常。为什么?,.net,asp.net-mvc-3,azure,signalr,.net,Asp.net Mvc 3,Azure,Signalr,我正在MVC 3.0 Windows Azure应用程序中使用SignalR。 以下行仅在Windows Azure emulator中引发ArgumentNullException。如果我运行MVC3.0应用程序而不是云应用程序,它不会抛出错误。(我还没有尝试在部署的云中运行此代码) 除了消息值不能为null之外,没有关于错误的其他信息。 参数名称:instanceName。我不知道它的实例名是什么 我不知道会出什么问题。 为什么会这样 编辑 这是完整的异常信息: System.Argumen

我正在MVC 3.0 Windows Azure应用程序中使用SignalR。 以下行仅在Windows Azure emulator中引发
ArgumentNullException
。如果我运行MVC3.0应用程序而不是云应用程序,它不会抛出错误。(我还没有尝试在部署的云中运行此代码)

除了消息
值不能为null之外,没有关于错误的其他信息。
参数名称:instanceName
。我不知道它的实例名是什么

我不知道会出什么问题。 为什么会这样

编辑

这是完整的异常信息:

System.ArgumentNullException未经处理HResult=-2147467261
Message=值不能为null。参数名称:instanceName
Source=Microsoft.AspNet.signal.Core ParamName=instanceName
堆栈跟踪: 在Microsoft.AspNet.signal.Hosting.HostDependencyResolveX.InitializeHost(IDependencyResolver)中 解析程序、字符串实例名、取消令牌主机关机令牌) 在Owin.Owin.UseType[T](IAppBuilder,对象[]args) 在Owin.Owin.MapHubs(IAppBuilder生成器、字符串路径、HUB配置) 在System.Web.Routing.SignalRouteeExtensions.c_DisplayClass7.b_5(IAppBuilder (地图) 在Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(操作
1
启动)
在Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(操作
1启动) 在System.Web.Routing.RouteCollectionExtensions.MapOwinPath(RouteCollection 路由、字符串名称、字符串路径库、操作“1启动”) 在System.Web.Routing.SignalRouteeExtensions.MapHubs(RouteCollection 路由、字符串名称、字符串路径、HUB配置) 在System.Web.Routing.SignalRouteeExtensions.MapHubs(RouteCollection 路由、字符串路径、HUB配置) 在System.Web.Routing.SignalRouteeExtensions.MapHubs(RouteCollection 路由、HUB配置) 在System.Web.Routing.SignalRouteeExtensions.MapHubs(RouteCollection (路线) 在Cerebello.mvcapapplication.RegisterRoutes(路由收集路由)中 c:\Projetos\Cerebello\Cerebello\CerebelloWebRole\Global.asax.cs:line 25 中的CerebelloWebRole.Code.Helpers.RouteHelper.RegisteralRoutes()处 c:\Projetos\Cerebello\Cerebello\CerebelloWebRole\Code\Helpers\RouteHelper.cs:line 82 在c:\Projetos\Cerebello\Cerebello\Cerebello\Cerebello\WebRole.cs中的CerebelloWebRole.WebRole.Run()处:第23行 在Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal()上 在Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRole()上 在Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.b__2()中 位于System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext、ContextCallback回调、对象状态、布尔值 (同步CTX) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔值 (同步CTX) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态) 位于System.Threading.ThreadHelper.ThreadStart()的内部异常:


不幸的是,这是一个已知的问题:


请随意评论这个问题。了解此错误发生在Windows Azure Emulator中非常有用。如果您在部署中发现这个问题,那么肯定也值得注意

似乎在IIS进程外部调用了
MapHubs()
,现在不允许这样做。如果您有一个注册路由的方法,并且该方法在IIS内外运行的代码之间共享,那么您必须确保仅从whithin IIS调用
MapHubs()

您能在github上提交一个bug吗?谢谢您的回复。对于我来说,是否有任何解决方法可以停止在模拟器中获取此错误?顺便说一句,我将在部署中测试它。
public static void RegisterRoutes(RouteCollection routes)
{
    RouteTable.Routes.MapHubs();
    // ...
}