Print Page | Close Window

Serialization exception on derived LoginException

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4116
Printed Date: 06-Sep-2025 at 6:54am


Topic: Serialization exception on derived LoginException
Posted By: kdev
Subject: Serialization exception on derived LoginException
Date Posted: 15-Apr-2013 at 10:13am
Hi,


I created my own LoginException but I every time I throw it get this error on the client (Silverlight 5) :
"The Login could not be completed because the server did not respond. Check that the server is available and contains a clientApplicationType configuration setting which supports this application."

Then I took the sample code from here http://drc.ideablade.com/devforce-2012/bin/view/Documentation/authentication-details-custom - http://drc.ideablade.com/devforce-2012/bin/view/Documentation/authentication-details-custom  to check my code and I still get the same error. (The class is defined on both the server and client)

On the log it seems there is a problem with the Serialization.

Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans Security.Domain.Services.tn.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans IdeaBlade.EntityModel.Server.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans System.ServiceModel.dll
Une exception de première chance de type 'Common.CustomLoginException' s'est produite dans System.ServiceModel.dll
Une exception de première chance de type 'System.Runtime.Serialization.SerializationException' s'est produite dans System.Runtime.Serialization.dll

My web.config configuration looks like this :

<ideablade.configuration xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig" version="6.00" clientApplicationType="Silverlight">
    <logging logFile="log\DebugLog.xml" port="9922" serviceName="TracePublisher" archiveLogs="false" />
    <objectServer>
      <serverSettings useAspNetSecurityServices="false" />
      <serverSettings allowAnonymousLogin="false" />
      <serverSettings supportedClientApplicationType="Silverlight"/>
    </objectServer>
    <!-- See the DevForce Resource Center for more information on configuration settings:
http://drc.ideablade.com/devforce-2012/bin/view/Documentation/deploy-iis#HConfiguration
    -->
  </ideablade.configuration>



Replies:
Posted By: kimj
Date Posted: 15-Apr-2013 at 5:14pm
Unfortunately, this is due to a bug. It looks like our reflection provider is not correctly handling the properties on LoginException sub-classes and causing a serialization problem. Afraid I can't think of a workaround.

We'll get this fixed in the next release, date TBD.


Posted By: kimj
Date Posted: 30-Apr-2013 at 5:56pm
kdev, this was fixed in the 7.1.2 release now available.


Posted By: kdev
Date Posted: 01-May-2013 at 12:25am
thanks kimj

I will try as soon as Cocktail will update it's dependencies to Devforce


Posted By: JohnBloom
Date Posted: 22-Aug-2013 at 1:20pm
Does this problem only exist for LoginException or does it block all custom exceptions even ones inheriting from System.Exception? I am on 7.1.0.0 and am hitting an error when I add my custom exception as a known type. I believe I followed all of the rules and so I am wondering if I need to upgrade because of the bug or if I am just not doing it right. 

[DataContract]|
//[DiscoverableType(DiscoverableTypeMode.KnownType)]
    public class MyException : Exception
    {
        [DataMember]
        public int Code { getset; }
 
        public MyException(string message, Dictionary<stringobject> userData) : base(message)
        {
            Code = (int) userData["Code"];
            //used for serialization
        }
 
        public MyException(string message, int code) : base(message)
        {
            Code = code;
        }
 
    }
If I uncomment that code the EntityServer will fail to start because it is not able to serialize MyException.


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 22-Aug-2013 at 2:12pm
I think I figured it out. I needed to inherit from EntityServerException.

-------------
-John Bloom



Print Page | Close Window