Strange error

Posts   
 
    
JMichelson
User
Posts: 34
Joined: 27-Dec-2003
# Posted on: 10-Jan-2004 09:35:43   

Hi Otis (is it Otis?).

I 'm getting a strange error trying to send an entity from the client to the server to be saved. Here is the server code:

using System;
using Proximity.Data ;
using Data.References ;
using Data.References.EntityClasses ;
using Data.References.TypedListClasses ;
using SD.LLBLGen.Pro.ORMSupportClasses ;

namespace Proximity.Data.References
{
       public class ReferenceDataFactory: BaseDataFactory (inherited from MarshalByRefObj)
    {
        public ReferenceDataFactory()
        {
        }

                                . . .

        public string SaveAccount (AccountEntity _account)
        {
                        try
            {
                 AccountEntity _saveAccount = new AccountEntity() ;
                 _saveAccount = _account ;
                 _saveAccount.Save() ;
                 return "Success" ;
            }
            catch (Exception e)
            {
                  return e.InnerException.ToString() ;
            }
        }
    }
}

The client code:

        private void button1_Click(object sender, System.EventArgs e)
        {
                                               // _o is the proxy of the server object ReferenceDataFactory
                                               // _account is the local Entity created from that proxy

            try
            {
                    this._o.SaveAccount(this._account) ;
            }
            catch(Exception d)
            {
                   ... etc
            } 
        }

The exception is of type: SerializationException and it says: "Because of security restrictions, the type SD.LLBLGen.Pro.ORMSupportClasses.EntityFields cannot be accessed."

This seems like much too simple code to be getting such a strange error message! Do you have any ideas?

Thanks in advance.

Jeff

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39619
Joined: 17-Aug-2003
# Posted on: 10-Jan-2004 12:48:37   

(It's Frans, but I use Otis as my handle on boards and I used to use that handle in the Amiga demoscene and PC demoscene in ancient days simple_smile . )

Here's your answer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconautomaticdeserializationinnetremoting.asp

simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JMichelson
User
Posts: 34
Joined: 27-Dec-2003
# Posted on: 11-Jan-2004 01:20:39   

Worked! Thanks Frans.