SignalR和MVC包 [英] SignalR and MVC bundle

查看:129
本文介绍了SignalR和MVC包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用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(见<一href=\"http://weblogs.asp.net/davidfowler/archive/2012/06/10/signalr-0-5-1-released.aspx\">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包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆