问题描述
我试图使用SignalR与MVC捆绑,但有找出如何包含/ signalr /集线器脚本到包问题。现在我必须插入路径jquery.signalR和我的code之间。这将导致在三个JavaScript文件的请求。
I'm trying to use SignalR with MVC bundle, but having problem finding out how to include the /signalr/hubs script into the bundle. For now I have to insert the path in between jquery.signalR and my code. That will result in three javascript file requests.
有什么办法,包括/ signalr /集线器到我的MVC包?
Is there any way to include /signalr/hubs into my mvc bundle?
推荐答案
默认/ signalr /集线器脚本运行时动态生成的第一个请求,然后缓存。
The default /signalr/hubs script is generated dynamically by the runtime on the first request and then cached.
您可以使用hubify.exe(见http://weblogs.asp.net/davidfowler/archive/2012/06/10/signalr-0-5-1-released.aspx了解详细信息),以pre-生成自己的文件,这样你就可以将其添加到了MVC包。
You can use hubify.exe (see http://weblogs.asp.net/davidfowler/archive/2012/06/10/signalr-0-5-1-released.aspx for details) to pre-generate the file yourself, so you can add it into the MVC bundle.
这篇关于SignalR和MVC包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!