Click here to Skip to main content
15,886,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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>
Posted

1 solution

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[^]
 
Share this answer
 
Comments
Maciej Los 3-Nov-14 7:31am    
+5
Kornfeld Eliyahu Peter 3-Nov-14 7:32am    
Thank you...
Kandiya 3-Nov-14 8:06am    
I have set as per the second line
<script src="/SignalR/hubs"

But Still while hosting the issue persists.But in Visual Studio 2010 there is no sucvh issue
Kornfeld Eliyahu Peter 3-Nov-14 8:13am    
I suggest to read the article behind the link...
It can be ~/SignalR/hubs or other depending your site exact map after publishing...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900