SerializationException...

IfYouSaySo

Well-known member
Joined
Jan 4, 2006
Messages
102
Location
Hermosa Beach, CA
Programming Experience
3-5
Hi,

I've made this simple remoting scenario, where I have:

1) dll class library with method A implementation
2) dll class library with only interface to A
3) client app that only has reference to interface dll
4) server that has reference to class library + interface dll.

The client only references the interface, never the actual object. It was my understanding that this was the mechanism that is to be used when you don't want the client application to have access to the implementation dll--whether for reasons of maintenence or security or whatever (this approach is given in both books and on various websites). So what I'm finding is that the code compiles fine but the client blows up with serialization exception, saying it can't find the assembly for A. If I add a reference to A in the client it works fine. So whats the deal?! If I have to put the implementation dll on the client why did I bother to create the interface? Am I missing something?

BTW I'm using Singleton not SingleCall or ClientActivated remoting.
 
OK so the problem was that I was returning a DataSet via my library A:

VB.NET:
Public Function A (ByVal s As String) As DataSet
    Dim ds As New MyStronglyTypedDataSet
    ' do stuff
    return ds 
End Function

Which is a problem because the strongly typed data set only exists in the library not the interface. I thought I was getting around needing to pass the strongly typed data set by returning an object of type DataSet but apparently that's not true. Anyway for other reasons, it makes sense to make the strongly typed data set exist in the interface dll, and now everything works...
 
Back
Top