Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / September 2005

Tip: Looking for answers? Try searching our database.

Confusing Remoting Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob Perkins - 08 Sep 2005 00:28 GMT
I'm getting the following error

An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: Cannot find the assembly SCQueueClientTest,
Version=1.0.2074.15411, Culture=neutral, PublicKeyToken=null.

...when I attempt to add an event handler delegate to a remoted object
called as follows:

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
        o =
Activator.GetObject(GetType(SCMessagingSingleton.SCMessageStore),
"tcp://localhost:64738/SCMessaging.rem")
        AddHandler o.TestEvent, AddressOf o_TestEvent
        o.TestFunction()
        RemoveHandler o.TestEvent, AddressOf o_TestEvent
    End Sub

    Private Sub o_TestEvent(ByVal sender As Object, ByVal e As
SCMessagingSingleton.SCMessageStoreEventArgs)
        MessageBox.Show(e.Message)
    End Sub

Without the AddHandler call, o.TestFunction() works perfectly.

Can anyone shed some light on this, bearing in mind that
"SCQueueClientTest" is the name of both the solution and the project for
this client, but is not explicitly declared in the project?

Setup code for the server is:
        Dim sp As New BinaryServerFormatterSinkProvider
        Dim cp As New BinaryClientFormatterSinkProvider
        Dim Properties As IDictionary = New Hashtable
        Dim channel As TcpChannel
        sp.TypeFilterLevel =
Runtime.Serialization.Formatters.TypeFilterLevel.Full
        Properties("port") = 64738

        channel = New TcpChannel(Properties, cp, sp)
        ChannelServices.RegisterChannel(channel)

        RemotingConfiguration.RegisterWellKnownServiceType( _
                    GetType(SCMessagingSingleton.SCMessageStore), _
                    "SCMessaging.rem", _
                    WellKnownObjectMode.Singleton)

And for the client:

        Dim ServerProvider As New BinaryServerFormatterSinkProvider
        Dim ClientProvider As New BinaryClientFormatterSinkProvider
        Dim Properties As IDictionary = New Hashtable
        Dim Channel As TcpChannel
        Dim RemoteType As WellKnownClientTypeEntry

        ServerProvider.TypeFilterLevel =
Runtime.Serialization.Formatters.TypeFilterLevel.Full
        Properties("port") = 0
        Channel = New TcpChannel(Properties, ClientProvider,
ServerProvider)
        ChannelServices.RegisterChannel(Channel)
        RemoteType = New
WellKnownClientTypeEntry(GetType(SCMessagingSingleton.SCMessageStore), _
                    "tcp://localhost:64738/SCMessaging.rem")
        RemotingConfiguration.RegisterWellKnownClientType(RemoteType)
Robert Jordan - 16 Sep 2005 19:00 GMT
Hi Rob,

> I'm getting the following error
>
[quoted text clipped - 4 lines]
> Additional information: Cannot find the assembly SCQueueClientTest,
> Version=1.0.2074.15411, Culture=neutral, PublicKeyToken=null.

See this article:

http://www.codeproject.com/csharp/RemotingAndEvents.asp

Rob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.