New Posts New Posts RSS Feed: Formatter Exception
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Formatter Exception

 Post Reply Post Reply
Author
antalakas View Drop Down
Newbie
Newbie
Avatar

Joined: 25-Jun-2007
Location: Greece
Posts: 28
Post Options Post Options   Quote antalakas Quote  Post ReplyReply Direct Link To This Post Topic: Formatter Exception
    Posted: 21-Oct-2009 at 6:31am
Hello,

I am running the sample ASPNET Membership with Registration with version 5.2.3, on a x64 Win7 machine. I know i set up everything properly, i have done this correctly before with x32 Win7 and version 5.2.2.

Now i receive a strange error:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:credential. The InnerException message was 'Element 'http://ideablade.com/EntityModel:credential' contains data of the 'http://ideablade.com/EntityModel:FormsAuthenticationLoginCredential' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'FormsAuthenticationLoginCredential' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.


Any ideas?

Thank you
Andreas Ntalakas
Back to Top
antalakas View Drop Down
Newbie
Newbie
Avatar

Joined: 25-Jun-2007
Location: Greece
Posts: 28
Post Options Post Options   Quote antalakas Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2009 at 6:58am
Update :

I tried the old version 5.2.2 on my new machine (x64, Win7) and worked as expected. I still cannot say though, whether x64 is the problem or the new version...

A

Edit : I will try to regenerate the model later, maybe this is the case.

Edit #2 : Regeneration had no success.

Edited by antalakas - 21-Oct-2009 at 7:47am
Andreas Ntalakas
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2009 at 8:37am
The FormsAuthenticationLoginCredential is defined in IdeaBlade.EntityModel.Web assembly (on the server; in the SL client it's defined in IdeaBlade.EntityModel).  Check that this assembly is in the bin folder of the web project, and also check the version number of the assembly.
Back to Top
antalakas View Drop Down
Newbie
Newbie
Avatar

Joined: 25-Jun-2007
Location: Greece
Posts: 28
Post Options Post Options   Quote antalakas Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2009 at 12:39pm
Everything is in place and the versions are correct. Anyway, it is the stock example, it used to work. I uninstalled 5.2.3 and reinstalled 5.2.2 and the example works.
Andreas Ntalakas
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 21-Oct-2009 at 5:10pm
Sorry about that, we did break this in 5.2.3.  We have a hotfix available now upon request, and will have an updated 5.2.3.x download on the web site within a week.
Back to Top
Jerome View Drop Down
Newbie
Newbie


Joined: 27-Oct-2009
Posts: 1
Post Options Post Options   Quote Jerome Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 1:20am
Hi,
 
Are there any updates on the problem described above?
 
Kind regards
 
 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 9:16am
We're testing the 5.2.3.1 release now and should have it ready within a day or so.  If you need anything sooner, shoot us an email at IdeaBladeSupportTrack@.
Back to Top
pk55 View Drop Down
Senior Member
Senior Member


Joined: 22-Jul-2009
Location: CA
Posts: 105
Post Options Post Options   Quote pk55 Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 2:14pm
I'm also getting a formatter problem trying to deserialize an entity cache state after invoking a server method to load entities.  Is this related to the error reported in this thread?  I've tried adding both the IKnownType interface as well as using the [DiscoverableType(DiscoverableTypeMode.KnownType)] on the class in the error message but it doesn't seem to make a difference.  We're using 5.2.3.

The error in the client side callback from the server method is:
 
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:InvokeServerMethodResult. The InnerException message was 'Element 'http://ideablade.com/EntityModel:ProbedKeyResolver' contains data of the 'http://schemas.datacontract.org/2004/07/RSS.Alliant.Business.BOS.Security:AlliantDataSourceKeyResolver' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'AlliantDataSourceKeyResolver' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'
 
Would the hotfix address this?
 
Thanks.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 3:19pm
The 5.2.3.1 update doesn't address this issue with the InvokeServerMethod.  You're likely seeing this problem because the AlliantDataSourceKeyResolver is defined (rightly) on only the server side.  You can easily work around the problem as follows:

[AllowRpc]
public static EntityCacheState AServerMethod(IPrincipal principal, EntityManager entityManager, params Object[] clientArgs) {
   // .. do stuff
   // Set the ProbedKeyResolver to null before retrieving the cache state, since
   // we don't need to send the resolver to the client.
   entityManager.DataSourceResolver.ProbedKeyResolver = null;
   EntityCacheState ecs = entityManager.CacheStateManager.GetCacheState();
   return ecs;
}
 
Back to Top
pk55 View Drop Down
Senior Member
Senior Member


Joined: 22-Jul-2009
Location: CA
Posts: 105
Post Options Post Options   Quote pk55 Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 3:43pm
Thanks Kim!  That was it.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2009 at 6:57pm
Version 5.2.3.1, which fixes the deserialization problems with the FormsAuthenticationLoginCredential and UserBase types, is now available from our website. 
Back to Top
mjwolfe View Drop Down
Newbie
Newbie
Avatar

Joined: 28-Oct-2009
Location: CA
Posts: 3
Post Options Post Options   Quote mjwolfe Quote  Post ReplyReply Direct Link To This Post Posted: 28-Oct-2009 at 9:45am
I went to the download area that we were given when we purchased but I only see 5.2.3, not 5.2.3.1. Is there a different location I need to go to for this fix release?
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Oct-2009 at 9:52am
We don't show the minor version (the ".1") of the release number on that page, but the actual download will be the latest release.
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 28-Oct-2009 at 9:59am
The name of the package is still "5.2.3".  The description of the package says "5.2.3".  We will change this to say "5.2.3.1".
 
After you install this version, you will notice that in add/Remove programs and in the documentation, the version will display as 5.2.3.  The Desktop shortcut will display as "IdeaBlade DevForce v5.2.3.1".  In the GAC, the Assembly Version number of the DLL's will be 5.2.3.1.
Back to Top
mjwolfe View Drop Down
Newbie
Newbie
Avatar

Joined: 28-Oct-2009
Location: CA
Posts: 3
Post Options Post Options   Quote mjwolfe Quote  Post ReplyReply Direct Link To This Post Posted: 28-Oct-2009 at 10:04am
Thanks. I was thrown off by the fact that the date was still the date of the 5.2.3 release.
Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post Posted: 30-Nov-2009 at 7:03pm
I'm afraid that Kim's suggestion for zapping the ProbedKeyResolver only gives the appearance of working ... as was discovered and explained here http://www.ideablade.com/forum/forum_posts.asp?TID=1573&PID=5885#5885
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down