CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Maximum number of properties allowed in WinRT object? (Adding the 59th property breaks DP method)

    rated by 0 users
    Not Answered This post has 0 verified answers | 1 Reply | 2 Followers

    Top 25 Contributor
    202 Posts
    Tim posted on Sat, Nov 15 2014 3:56 PM

    Scenario: WinRT project with CSLA 4.5.

    I've come across a weird situation where when I add one additional property to a particularly large object, the object breaks when the DP_Create method is called. It doesn't matter what kind of property I add (bool, int, whatever). The object has 58 properties, but when the 59th is added, I get an exception.

    In a factory method on the object, I'm calling the DP_Create method as as follows:

    var line = DataPortal.Create<OrderLineEdit>(criteria);

    When this line is executed, I get back the following error without any chance of stepping into the DP_Create method even though a breakpoint is in there.

    "An exception of type 'Csla.DataPortalException' occurred in mscorlib.dll but was not handled in user code

    Additional information: DataPortal.Create failed (Object reference not set to an instance of an object.)"

    I've spent hours going through the possibilities, including making sure all objects, including criteria objects, have default public constructors which I've found are needed in WinRT. The DP_Create method is run locally, per our custom proxy factory and by the fact it is in a compiler directive to run only NETFX_CORE, and I've even marked the method with the [RunLocal] attribute just to make sure, with that making no difference. Everything being done in this local DP_Create method does nothing spectacular (no database calls obviously, not interaction with other objects...simply setting simple type properties like ints, strings, etc.).

    What I've finally stumbled onto is that when I remove a property (any property), everything starts working. And when I add a new property (of any data type, with any random name and not referenced by any code) it stops working and throws this exception. This leads me to the question of whether there is any sort of max # of properties allowed on an object running in the WinRT stack.

    Any ideas? Thanks.

    Tim

    All Replies

    Top 10 Contributor
    9,475 Posts

    That's very strange. Still having this issue? If so can you post the stack trace, not just the top level exception?

    Rocky

    Page 1 of 1 (2 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems