Print Page | Close Window

Formatter Exception

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1527
Printed Date: 26-Apr-2024 at 6:19am


Topic: Formatter Exception
Posted By: antalakas
Subject: Formatter Exception
Date 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



Replies:
Posted By: antalakas
Date 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.

-------------
Andreas Ntalakas


Posted By: kimj
Date 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.


Posted By: antalakas
Date 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


Posted By: kimj
Date 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.


Posted By: Jerome
Date Posted: 27-Oct-2009 at 1:20am
Hi,
 
Are there any updates on the problem described above?
 
Kind regards
 
 


Posted By: kimj
Date 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@.


Posted By: pk55
Date 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 - 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.


Posted By: kimj
Date 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;
}
 


Posted By: pk55
Date Posted: 27-Oct-2009 at 3:43pm
Thanks Kim!  That was it.


Posted By: kimj
Date 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. 


Posted By: mjwolfe
Date 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?


Posted By: kimj
Date 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.


Posted By: davidklitzke
Date 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.


Posted By: mjwolfe
Date 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.


Posted By: WardBell
Date 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 - http://www.ideablade.com/forum/forum_posts.asp?TID=1573&PID=5885#5885



Print Page | Close Window