Den*_*nis 2 c# intellisense visual-studio asp.net-mvc-3 signalr
我目前正在与SignalR合作开展一个项目.在我的生产服务器上,它缺少一个自动生成的js文件~/signalr/hubs.我想尝试这个解决方案:
SignalR无法在生产服务器上运行
但是当我尝试将此行添加到我的application_start方法中时global.asax,我的项目将不再构建.虽然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?)
Run Code Online (Sandbox Code Playgroud)
当作为静态方法调用时:
Error 1 The type or namespace name 'RouteExtensions' does not exist in the namespace 'SignalR' (are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会这样,以及如何解决问题?提前谢谢了!
我很确定这可能是以下原因之一:
根据您提供的信息,很难确定确切的原因,但我相信我为您提供了一些有用的提示.
intellisense建议您使用扩展方法这一事实并不意味着项目具有正常工作所需的参考.