0

I have a MVC5 project using signalr to perform updates to a list. Inside script.js, there is a variable link to defined as var link = $.connection.hub. There is also a bundleconfig file to load the dependent scripts, signalr/jquery and jquery in the proper order of course. The script /signalr/hubs is loaded in from the html manually.

bundles.Add(new ScriptBundle("~/bundles/signalr").Include(
"~/Scripts/script.js",
"~/Scripts/jquery.signalR-2.0.2.min.js"));

When the VS 2013 Web project is run, it works fine until the project is copied over to another PC that it does not work as intended. The variable link is undefined as $.connection is undefined too ($ is defined though).

I presume that jquery.signalR-2.0.2.min.js is not read or executed at all.

Questions:

  • Might this have anything to do with the environment of the PCs? (Windows 7 is OK, Windows 8 is not OK)
  • What could prevent jquery.signalR-2.0.2.min.js from running?
  • Does creating a new View/Controller play a part in the error (creating a view, using a layout page)?
William Price
  • 4,033
  • 1
  • 35
  • 54
Ed L 005
  • 157
  • 3
  • 14

1 Answers1

0

Please see similar question: SignalR and MVC bundle as it shows how to add SignalR into an MVC bundle. I think their answer should help solve your problem.

I would comment instead of answer, but I don't have enough reputation.

Community
  • 1
  • 1
Stu
  • 69
  • 7