Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.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
Signalr 升级到信号器2.1.1会导致现在找不到响应_Signalr_Signalr Hub_T4mvc - Fatal编程技术网

Signalr 升级到信号器2.1.1会导致现在找不到响应

Signalr 升级到信号器2.1.1会导致现在找不到响应,signalr,signalr-hub,t4mvc,Signalr,Signalr Hub,T4mvc,在集线器上调用方法时,下面最后一行出现错误。这以前从未发生过。我正在使用T4MVC 错误 Additional information: Response is not available in this context. 集线器 public void Viewing() { var urlHelper = new UrlHelper(Context.Request.GetHttpContext().Request.RequestContext);

在集线器上调用方法时,下面最后一行出现错误。这以前从未发生过。我正在使用T4MVC

错误

Additional information: Response is not available in this context.
集线器

public void Viewing()
        {
            var urlHelper = new UrlHelper(Context.Request.GetHttpContext().Request.RequestContext);
            var url = urlHelper.Action(MVC.Directors.EventSchedule.Index(EventId));
检查
RequestContext
对象的
Response
会给我:
'(request.HttpContext)。Response'引发了类型为'System.Web.HttpException'的异常。

堆栈跟踪

   at System.Web.HttpContext.get_Response()
   at System.Web.HttpContextWrapper.get_Response()
   at System.Web.UI.Util.GetUrlWithApplicationPath(HttpContextBase context, String url)
   at System.Web.Routing.RouteCollection.NormalizeVirtualPath(RequestContext requestContext, String virtualPath)
   at System.Web.Routing.RouteCollection.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
   at System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection routes, RequestContext requestContext, String name, RouteValueDictionary values, Boolean& usingAreas)
   at System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection routes, RequestContext requestContext, String name, RouteValueDictionary values)
   at System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues)
   at System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues)
   at System.Web.Mvc.UrlHelper.RouteUrl(String routeName, RouteValueDictionary routeValues, String protocol, String hostName)
   at System.Web.Mvc.T4Extensions.Action(UrlHelper urlHelper, ActionResult result, String protocol, String hostName)
   at System.Web.Mvc.T4Extensions.Action(UrlHelper urlHelper, ActionResult result)
   at Tournaments.Models.Mvc.SignalR.ScheduleHub.Viewing() in f:\My Webs\...\ScheduleHub.cs:line 113
   at lambda_method(Closure , IHub , Object[] )
   at Microsoft.AspNet.SignalR.Hubs.HubMethodDispatcher.<>c__DisplayClass1.<WrapVoidAction>b__0(IHub hub, Object[] parameters)
   at Microsoft.AspNet.SignalR.Hubs.HubMethodDispatcher.Execute(IHub hub, Object[] parameters)
   at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.Incoming(IHubIncomingInvokerContext context)
at System.Web.HttpContext.get_Response()
在System.Web.HttpContextWrapper.get_Response()中
位于System.Web.UI.Util.GetUrlWithApplicationPath(HttpContextBase上下文,字符串url)
位于System.Web.Routing.RouteCollection.NormalizeVirtualPath(RequestContext RequestContext,String virtualPath)
位于System.Web.Routing.RouteCollection.GetVirtualPath(RequestContext RequestContext,RouteValueDictionary值)
位于System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection路由、RequestContext请求上下文、字符串名称、RouteValueDictionary值、布尔值和usingAreas)
位于System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection路由、RequestContext请求上下文、字符串名称、RouteValueDictionary值)
位于System.Web.Mvc.UrlHelper.GenerateUrl(字符串routeName、字符串actionName、字符串controllerName、RouteValueDictionary routeValues、RouteCollection RouteCollection、RequestContext RequestContext、Boolean includeImplicitMvcValues)
位于System.Web.Mvc.UrlHelper.GenerateUrl(字符串routeName、字符串actionName、字符串controllerName、字符串协议、字符串主机名、字符串片段、RouteValueDictionary routeValues、RouteCollection RouteCollection、RequestContext RequestContext、Boolean includeImplicitMvcValues)
位于System.Web.Mvc.UrlHelper.RouteUrl(字符串routeName、RouteValueDictionary routeValues、字符串协议、字符串主机名)
位于System.Web.Mvc.T4Extensions.Action(UrlHelper UrlHelper、ActionResult结果、字符串协议、字符串主机名)
位于System.Web.Mvc.T4Extensions.Action(UrlHelper UrlHelper,ActionResult)
在f:\My Webs\…\ScheduleHub.cs:第113行的Tournaments.Models.Mvc.signal.ScheduleHub.Viewing()中
在lambda_方法中(闭包、IHub、对象[])
在Microsoft.AspNet.signal.Hubs.HubMethodDispatcher.c__DisplayClass1.b__0(IHub hub,对象[]参数)
在Microsoft.AspNet.signal.Hubs.HubMethodDispatcher.Execute(IHub-hub,Object[]参数)
位于Microsoft.AspNet.signal.Hubs.HubDispatcher.Incoming(IHubIncomingInvokerContext上下文)

您是否有针对该错误的调用堆栈?其他方法有效吗?您从哪个版本升级?我是从2.1.1升级的,我的意思是2.1.0是版本。您是否尝试了上下文。改为请求?