Hello everyone and thanks for your helpin advance. I have a SignalR application that works fine on my Windows 7 development machine, but fails on my Windows Server 2012 production server. The console shows the error message SignalR: notificationhub.SendNotifications
failed to execute. Error: There was an error invoking Hub method 'notificationhub.SendNotifications'. I am assuming the page is unable to access the hub, but I don't know why. Any help would be appreciated.
Thanks for the response. I have already done that:
Imports Microsoft.AspNet.SignalR
Imports Microsoft.AspNet.SignalR.Hubs
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Linq
Imports System.Web
<HubName("notificationHub")>
Public Class NotificationHub
Inherits Hub
Public Function SendNotifications()
Dim hubConfig As HubConfiguration = New HubConfiguration
hubConfig.EnableDetailedErrors = True
Dim ApptList As New List(Of [ApptDetails])()
Dim conn As String = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Using connection = New SqlConnection(conn)
Dim query As String = "Select PatientID, PatientFirstName, PatientLastName, PatientDOB, ApptDate, ApptTime, ApptDescription From tblAppointments Where ApptDate between '04/28/2014 12:00:00 am' and '04/28/2014 11:00:00 pm'"
connection.Open()
SqlDependency.Start(conn)
Using command As New SqlCommand(query, connection)
command.Notification = Nothing
Dim dt As New DataTable()
Dim dependency As New SqlDependency(command)
dependency.AddCommandDependency(command)
AddHandler dependency.OnChange, AddressOf dependency_OnChange
If connection.State = ConnectionState.Closed Then
connection.Open()
End If
Dim reader = command.ExecuteReader()
'Dim counter As Integer = 0
While reader.Read
Dim newItem As New [ApptDetails]()
newItem.PatientId = reader.GetString(0)
newItem.PatientFirstName = reader.GetString(1)
newItem.PatientLastName = reader.GetString(2)
newItem.PatientDOB = reader.GetString(3)
newItem.ApptDate = reader.GetDateTime(4)
newItem.ApptTime = reader.GetString(5)
newItem.ApptDescription = reader.GetString(6)
ApptList.Add(newItem)
End While
End Using
End Using
Dim context As IHubContext = GlobalHost.ConnectionManager.GetHubContext(Of NotificationHub)()
Return context.Clients.All.RecieveNotification(ApptList)
End Function
Private Sub dependency_OnChange(sender As Object, e As SqlNotificationEventArgs)
Dim nHub As New NotificationHub()
nHub.SendNotifications()
End Sub
End Class
Member
308 Points
1663 Posts
Page not Working on Production Server
May 19, 2014 01:10 PM|kmcnet|LINK
Hello everyone and thanks for your helpin advance. I have a SignalR application that works fine on my Windows 7 development machine, but fails on my Windows Server 2012 production server. The console shows the error message SignalR: notificationhub.SendNotifications failed to execute. Error: There was an error invoking Hub method 'notificationhub.SendNotifications'. I am assuming the page is unable to access the hub, but I don't know why. Any help would be appreciated.
Participant
1060 Points
346 Posts
Re: Page not Working on Production Server
May 19, 2014 03:20 PM|Sumit.Pokhriyal|LINK
var hubConfiguration = new HubConfiguration();
hubConfiguration.EnableDetailedErrors = true;
App.MapSignalR(hubConfiguration);
Can you enable above setting and post the detailed error ?
/**** Please remember to "Mark as Answer" the responses that resolved your issue. ****/
Member
308 Points
1663 Posts
Re: Page not Working on Production Server
May 19, 2014 03:31 PM|kmcnet|LINK
Thanks for the response. I have already done that:
This is my code.