CSLA 2.0.3 to CSLA 2.1

CSLA 2.0.3 to CSLA 2.1

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


randalv posted on Tuesday, March 16, 2010

I am having problems upgrading from CSLA 2.0.3 to 2.1.

I have figured out how to upgrade the validation rules, but I am receiving an error while saving one of my objects.

the error I receive is Type 'System.Data.Common.DbConnection' in Assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

 

Can anyone tell me what I need to change to get this to work?

 

Thanks

skagen00 replied on Tuesday, March 16, 2010

You must have a handle to a DbConnection as a member variable for a business object you're trying to serialize or you have a HANDLE to an object from within a business object you're trying to serialize (doing any sort of data portal operation with, really).

Anything that is part of the object graph will attempt to be serialized - and as you can see, DbConnection is not marked as serializable.

JonnyBee replied on Thursday, March 18, 2010

Hi,

Or - you have put the DbConnection in ApplicationContext.ClientContext or ApplicationContext.GlobalContext that are also serialized. If this is the case then change to use ApplicationContext.LocalContext instead as LocalContext only exist on the running machine and is not serialized to remote portal.

Copyright (c) Marimer LLC