0

I'm using SignalR libs for my c# project and I can't understand why it isn't working. I have these in my server side

enter image description here

and in client side

enter image description here

but I'm having an error, Uncaught TypeError: Cannot read property 'systemHealthHub' of undefined. What did I miss ? I haven't got such a file <script src="~/signalr/hubs"></script> file in my project. Maybe was that the reason? Can someone help me pls? Thanks!

2 Answers 2

0

Double check your Start.cs

 public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);
        app.MapSignalR();

    }

Then change this line.

var healthInfo = $.connection.systemHealth;
Sign up to request clarification or add additional context in comments.

Comments

0

It seems that you are not bringing in the /signalr/hubs file.

Bundle:

bundles.Add(new ScriptBundle("~/bundles/signalr").Include(
                  "~/Scripts/jquery.signalR-{version}.js"));

View:

@section Scripts {
    @Scripts.Render("~/bundles/signalr")
    @Scripts.Render("/signalr/hubs")
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.