Click here to Skip to main content
15,892,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem with event that doesnt raise when its raised from client. Searshed for a solution for days now without any luck...

I dont know if its a WCF problem or a general VB.net problem. Maybe threading problem?

No error messages at all.

VB
'My WCF service class
   Public Class LogProLiveCommunication
    Implements ILogProLiveCommunication

    Public Event Test(ByVal sender As System.Object, ByVal e As System.EventArgs)

   'This function is called by the WCF client and works ok except from the raise event Test!?!
    Public Function ConnectToLogProLive(ByVal clientName As String, ByVal clientIP As String) As String Implements ILogProLiveCommunication.ConnectToLogProLive
        MsgBox("Client Connected: " & clientName & " IP: " & clientIP)
        Debug.Write("Service: RaiseEvent Client Connected: " & clientName & " IP: " & clientIP) 'This works
        RaiseEvent Test(Me, New EventArgs) 'This doesnt work
        Return "Ok" 'Works
    End Function

    Public Sub raiseEventTest()
        RaiseEvent Test(Me, New EventArgs) 'This one is fired ok
    End Sub

End Class
Posted

1 solution

Maybe the event is being raised but you haven't set a listener on it yet, ie ConnectToLogProLive is being called before you have registered your listener.
 
Share this answer
 

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