我目前正在与SignalR合作一个项目。在我的生产服务器上,它在~/signalr/hubs中缺少一个自动生成的js文件。我想尝试这个解决方案:SignalR not working on production server
但是当我尝试在global.asax中将这一行添加到我的application_start方法中时,我的项目将不再构建。尽管intellisense知道并建议使用扩展方法!
我用using SignalR;引用了名称空间。我尝试将其作为扩展方法调用,并以对象实例作为第一个参数作为静态方法进行调用。确切的错误消息:
作为扩展方法调用时:
Error 1 'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHubs' and no extension method 'MapHubs' accepting a first argument of type 'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?)作为静态方法调用时:
Error 1 The type or namespace name 'RouteExtensions' does not exist in the namespace 'SignalR' (are you missing an assembly reference?) 有谁知道为什么会发生这种情况,以及如何解决这个问题?首先要感谢大家!
发布于 2012-12-19 22:11:47
我很确定这可能是以下原因之一:
根据您提供的信息,很难确定确切的原因,但我相信我为您提供了一些有用的提示。
事实上,intellisense建议您使用类似于扩展方法的方法,这并不意味着项目具有正常工作所需的引用。
https://stackoverflow.com/questions/13953723
复制相似问题