deserialization error while using remoting

deserialization error while using remoting

Old forum URL: forums.lhotka.net/forums/t/5360.aspx


Mary posted on Monday, September 08, 2008

Hi,

I am quite new to Csla and .Net remoting concepts. I am trying to create a windows application similar to ProjectTracker. But I am getting serialization errors, which i cant find out why or how :(

I have a Businessbase class(Order) with two CommandBase classes(Command1 and Command2) inside it.The code looks like this

[serializable()]

Public class Order : Businessbase<Order>

{

public static int GetCommand1()

{

Command1  result;

result = DataPortal.Execute<Command1 >(new  Command1 (any int value));

return result.GetCount;

}

[serializable()]

private class Command1 : Commandbase

{

public Command1 (int a){//Do something}

protected override void DataPortal_Execute(){//Fetch count from Database}

public int GetCount(){//return count}

}

[serializable()]

private class Command2 : Commandbase{}

}

When runing the code without remoting everything works fine. But when remoting is enabled , Order.GetCommand1() function call is giving an exception "Unable to load type Order+Command1 for deserialization" from Csla.dataPortalClient.RemotingProxy class.

1. Can anybody help me to figure out why i am getting this exception even after setting [serializable()] attribute in the begining of class definition?

2. When i am trying to debugg this part of code, break points in server side code is not hit. I was wondering how to enable debugging in server side code. I am very new to all this, So it will be very helpfull if somebody could tell me the basics :)

 

dlabar replied on Wednesday, October 15, 2008

Any chance that your compiled server code isn't marked as serializable? That would cause an error like this.

Copyright (c) Marimer LLC