0
votes

I am successfully running SignalR application on my LocalHost using VS 2010 (4.0 frameWork) And SignalR version 1.1.3 as per following link:

http://www.asp.net/signalr/overview/signalr-1x/getting-started/tutorial-getting-started-with-signalr

But When i deploy this Web Application on my IIS Server:

It throws Javascript Error as

'client' is null or not an object

What should I check..?

TIA

2
You should check the Framework version again. Asp.Net clearly states: "SignalR 2.0 is only supported on .NET Famework 4.5."Marco
Hey, But when i'm running it on my computer, its working good...Akash

2 Answers

0
votes

Do you have a script reference to both the client library and ~/signalR/hubs?

0
votes

This happens due to not correctly including the dynamic signalr hubs file. In the sample you're reference they are doing:

<script src="/signalr/hubs"></script>

Which is perfectly fine locally. However, if you are to deploy that application to IIS you'd need to ensure that your app is running at the ROOT if you're server.

I'm guessing when you deploy to IIS you're hosting it off of an endpoint like localhost/mysignalrapp/YOUR_STUFF. If that's the case the /signalr/hubs inclusion will not work.

Assuming your html file is at the root if your project try changing the include to:

<script src="signalr/hubs"></script>

This will enable your app to correctly find the signalr endpoint. If you happen to have your HTML file in folders not at the root, adjust the path accordingly.