473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

serializing/deserializing with remoting

I am using .NET remoting with a class,call it MyClass, that
contains many other classes (say one of them is
MySubClass). I have been able to successfully call
functions from the MyClass, but when I try to access the
sub-classes it gives me a:
System.Runtime.Serialization.SerializationExceptio n
"The constructor to deserialze an object of type
MyClass.MySubClass was not found."

error. I do have the '[Serializable]' modifier preceeding
the MyClass defn. and preceeding the other subclasses as well.
Also I have included an extra line for MySubClass in my
server.exe.config:

<service>
<wellknown
type="MyNameSpace.MyClass,MyAssemblyName"
objectUri = "MyClass.soap"
mode="Singleton"
/>
<wellknown type="MyNameSpace.MyClass.MySubClass,MyAssemblyNam e"
objectUri = "MyClass/MySubClass.soap"
mode="Singleton"
/>
</service>

as well as the corresponding lines in the client.exe.config.
What is the serialization/deserialization process for remoting?
What am I missing?

Cheers,

Jeff.
Nov 15 '05 #1
1 2401
Chances are that one of your objects implements the ISerializable interface
(or inherits from a class that does). This typically happens on type-safe
collections.
That being the case, you need to include the deserialization constructor on
that class (check the help docs for the exact signature of the constructor)
and call the base deserialization constructor from there. Remember that
constructors on the base object aren't propegated to the derived object in
inheritance.

-Rob [MVP]

"jeff" <j.*******@comcast.net> wrote in message
news:0e****************************@phx.gbl...
I am using .NET remoting with a class,call it MyClass, that
contains many other classes (say one of them is
MySubClass). I have been able to successfully call
functions from the MyClass, but when I try to access the
sub-classes it gives me a:
System.Runtime.Serialization.SerializationExceptio n
"The constructor to deserialze an object of type
MyClass.MySubClass was not found."

error. I do have the '[Serializable]' modifier preceeding
the MyClass defn. and preceeding the other subclasses as well.
Also I have included an extra line for MySubClass in my
server.exe.config:

<service>
<wellknown
type="MyNameSpace.MyClass,MyAssemblyName"
objectUri = "MyClass.soap"
mode="Singleton"
/>
<wellknown type="MyNameSpace.MyClass.MySubClass,MyAssemblyNam e"
objectUri = "MyClass/MySubClass.soap"
mode="Singleton"
/>
</service>

as well as the corresponding lines in the client.exe.config.
What is the serialization/deserialization process for remoting?
What am I missing?

Cheers,

Jeff.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike Peretz | last post by:
I don't know why, but for some reason exception do not serialize correctly when they hold a typed dataset. I have added code to serialize the dataset, but still when it gets to the other appDomain,...
3
by: Don McNamara | last post by:
Hi, I've hit quite a strange problem with XmlSerializer on my W2K3 server. When I serialize/deserialize using an exe on my local computer (XP), everything works fine. When I put the code out on...
3
by: Bruno Jouhier | last post by:
Is there a way to serialize a graph of objects and get the output as an XML document, without first serializing to text and then parsing the text (I know how to do this but I find it really silly...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
2
by: Earl Teigrob | last post by:
I am saving and restoring value types such as Int32, DateTime and Boolean in strings. I was wondering if there is a mechanism build into .NET for serializing and deserializing these to string...
3
by: MioTheGreat | last post by:
I know how to take a single hashtable, and then use a binaryformatter and a filestream to dump it to a file, but I need to serialize and deserialize a hashtable inside a class. I've been trying...
0
by: Michael Maercker | last post by:
Hi! I'm about to go nuts over my serializing problem. This is my situation: I have a Data-Class that can have children of the same class which are stored in a hashtable, i.e: X has A as a...
7
by: fjlaga | last post by:
I have written an Office Add-in for Excel using VB.NET and the .NET 1.1 Framework (I have Visual Studio 2003 .NET ). All works great. I want to add a User Settings/Prefereneces dialog and allow...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.