Specified argument was out of the range of valid values.

Specified argument was out of the range of valid values.

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


griff posted on Saturday, May 04, 2013

Csla 4.3.10.0  Silverlight app

I am getting the following error.

"Specified argument was out of the range of valid values. Parameter name: Unhandled CSLA Known type was found"

This occurs at this point

 

 public static void GetAuthorNVL(EventHandler<DataPortalResult<AuthorNVL>> callback)

        {

            if (_list == null)

                DataPortal.BeginFetch<AuthorNVL>((o, e) =>

                    {

                        _list = e.Object;

                        callback(o, e);

                    });

            else

                callback(null, new DataPortalResult<AuthorNVL>(_list, null, null));

        }

 

 

on the Beginfetch - it does not get to the dataportal.  The error bubbles up to my ViewModel.

It occurs for all objects - background is I have created a new SL  project and added in existing  libraries from another working project (so I know the libraries/code works)..  I'm sure it is something to do with the way the project has been set up (rather than specific code).  

Can anyone help please.

 

 

RockfordLhotka replied on Tuesday, May 07, 2013

This sounds like a serialization issue, probably where some non-supported type is being used for a property value.

The MobileFormatter serializer knows how to serialize the primitive types in .NET, plus String and Guid and DateTime, and it knows how to serialize custom types that implement IMobileObject (which includes any type that subclasses the standard CSLA base types).

Anything else won't serialize and would result in a known type exception.

griff replied on Friday, May 10, 2013

Yes I had a look at the source code to see where it was coming from - I guess this is one of those spurious error messages (the error was occurring on all bo's) - I recreated the project from scratch and after hitting a few issues along  the way it was  resolved - I think it issues lay with some sort of incorrect referencing when the project was set up.

Thanks for you time.

Copyright (c) Marimer LLC