gpt4 book ai didi

.net - RouteTable.Routes.MapHubs() 仅在 Windows Azure 模拟器中抛出 ArgumentNullException。为什么?

转载 作者:行者123 更新时间:2023-12-01 19:55:01 24 4
gpt4 key购买 nike

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

public static void RegisterRoutes(RouteCollection routes)
{
RouteTable.Routes.MapHubs();
// ...
}

除了消息 Value 不能为空之外,没有任何有关该错误的其他信息。
参数名称:instanceName
。我不知道实例名称是什么。

我不知道可能出了什么问题。为什么会发生这种情况?

编辑

这是完整的异常信息:

System.ArgumentNullException was unhandled HResult=-2147467261
Message=Value cannot be null. Parameter name: instanceName
Source=Microsoft.AspNet.SignalR.Core ParamName=instanceName
StackTrace: at Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeHost(IDependencyResolver resolver, String instanceName, CancellationToken hostShutdownToken) at Owin.OwinExtensions.UseType[T](IAppBuilder builder, Object[] args) at Owin.OwinExtensions.MapHubs(IAppBuilder builder, String path, HubConfiguration configuration) at System.Web.Routing.SignalRRouteExtensions.<>c_DisplayClass7.b_5(IAppBuilder map) at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1
startup)
at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action
1 startup) at System.Web.Routing.RouteCollectionExtensions.MapOwinPath(RouteCollection routes, String name, String pathBase, Action`1 startup) at System.Web.Routing.SignalRRouteExtensions.MapHubs(RouteCollection routes, String name, String path, HubConfiguration configuration) at System.Web.Routing.SignalRRouteExtensions.MapHubs(RouteCollection routes, String path, HubConfiguration configuration) at System.Web.Routing.SignalRRouteExtensions.MapHubs(RouteCollection routes, HubConfiguration configuration) at System.Web.Routing.SignalRRouteExtensions.MapHubs(RouteCollection routes) at Cerebello.MvcApplication.RegisterRoutes(RouteCollection routes) in c:\Projetos\Cerebello\Cerebello\CerebelloWebRole\Global.asax.cs:line 25 at CerebelloWebRole.Code.Helpers.RouteHelper.RegisterAllRoutes() in c:\Projetos\Cerebello\Cerebello\CerebelloWebRole\Code\Helpers\RouteHelper.cs:line 82 at CerebelloWebRole.WebRole.Run() in c:\Projetos\Cerebello\Cerebello\CerebelloWebRole\WebRole.cs:line 23 at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal() at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRole() at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.b__2() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

最佳答案

不幸的是,这是一个已知问题:https://github.com/SignalR/SignalR/issues/1616

请随时对此问题发表评论。了解此错误发生在 Windows Azure 模拟器中是很有用的。如果您发现这个问题在部署中出现,那也绝对值得注意。

关于.net - RouteTable.Routes.MapHubs() 仅在 Windows Azure 模拟器中抛出 ArgumentNullException。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15593337/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com