为什么在IIS中托管时没有生成hub.js? [英] Why hub.js not getting generated on hosting in IIS?

查看:109
本文介绍了为什么在IIS中托管时没有生成hub.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在IIS中托管时没有生成hub.js?



我在asp.net用c#开发了一个带有SignalR技术的多人游戏。在Visual Studio 4.0版本中,它作为hub.js工作是动态生成的。但是在IIS中托管时,hub.js不会生成,因此同样不起作用。我尝试使用Resolve Url和tilde。问题仍然存在。



< script type =text / javascript

src =http://code.jquery。 com / jquery-latest.jscharset =utf-8>

< / script>



< script src =<%= ResolveUrl(〜/ Scripts / jquery-ui-1.11.1.js)%>>< / script>

< script src =< ;%= ResolveUrl(〜/ Scripts / jquery.signalR-1.0.1.min.js)%>>< / script>

< script src =/ SignalR / hubs /%>>< / script>

Why hub.js not getting generated on hosting in IIS?

I have developed a Multiplayer Game with SignalR Technology in asp.net with c#. In Visual Studio 4.0 version its working as hub.js is generated dynamically. But on hosting in IIS the hub.js isn't generated and hence the same isn't working. I tried with Resolve Url and also with tilde. Still the Issue persists.

<script type="text/javascript"
src="http://code.jquery.com/jquery-latest.js" charset="utf-8">
</script>

<script src="<%= ResolveUrl("~/Scripts/jquery-ui-1.11.1.js") %>"></script>
<script src="<%= ResolveUrl("~/Scripts/jquery.signalR-1.0.1.min.js") %>"></script>
<script src="/SignalR/hubs/" %>"></script>

推荐答案

您的最后一行 - 包含集线器 - 有一些错误...

1.语法错误,可以阻止浏览器甚至解析此行

< script src =/ SignalR / hubs /%>>< / script>

2.您处理SignalR / hubs就像文件夹一样(带有动态内容) )...

< script src =/ SignalR / hubs< / script>

在这里阅读所有Sig nalR / hub问题......

http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client [ ^ ]
Your last line - to include the hubs - have some errors...
1. A syntax error, that can prevent form the browser to even parse this line
<script src="/SignalR/hubs/" %>"></script>
2. You handle SignalR/hubs like a folder where it is a file (with dynamic content)...
<script src="/SignalR/hubs"</script>
Read here about all the SignalR/hub issues...
http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client[^]


这篇关于为什么在IIS中托管时没有生成hub.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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