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
  • “Object of type ‘System.collection.generic.list`1[Lms.WebApp.BO.Account]’ cannot be converted to type ‘Csla.Core.MobilList`1 [Lms.WebApp.BO.Account]’ ”.

    rated by 0 users
    Not Answered This post has 0 verified answers | 5 Replies | 1 Follower

    Not Ranked
    5 Posts
    Riz posted on Thu, Jan 30 2014 10:52 AM

    Hi Everyone

    Currently we are using CSLA version 2.1.4 along with .NET version 3.5. Now we are looking for CSLA version upgrade. After doing some investigation we decided to upgrade the CSLA version to “3.8.3”. So to start with we first upgraded the CSLA version to 3.8.3 then also changed the .NET framework version to 4.5 for web application, and for the libraries and BO’s we keep the .NET Framework version as 3.5. After doing these changes we build all our projects the build was successful with upgraded CSLA version 3.8.3. Now while testing the webpages we come across one issue as mentioned below:

    Error:

     “Object of type ‘System.collection.generic.list`1[Lms.WebApp.BO.Account]’ cannot be converted to type ‘Csla.Core.MobilList`1 [Lms.WebApp.BO.Account]’ ”.

    While debugging the code we are  getting the issue, when deserializing the “object”.

    How can we fix the above mentioned issue, we are not able to get any proper solution to fix this issue.  

     

    Thanks for your help in advance.

    All Replies

    Top 10 Contributor
    2,279 Posts

    You cannot use the standard List<T> object with the MobileFormatter (serialize/deserializer) . You must use one of the list objects provided by CSLA such as 

    • MobileList<T>
    • BusinessListBase<T>
    • BusinessBindingListBase<T>
    • ReadOnlyListBase<T>
    • ReadOnlyBindingListBase<T>

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    5 Posts
    Riz replied on Fri, Jan 31 2014 10:13 AM

    Thanks for your reply Jonny.

    Actually we don’t want to use the “MobileFormatter” as there are many classes in which we will need to do the changes which will be not feasible for us now so by considering this is there any way to use the “BinaryFormatter” as it was used in earlier csla versions and then can we generate the “StandardList” instead of "MobileList" while using the CSLA version 3.8.3. If this is possible then where shall we do these changes?

     

    We appreciate your help on  this.

    Top 10 Contributor
    2,279 Posts

    Hi,

    1. You should verify that all layers of your application use the same CSLA dll (and version) as well as configuration. 
    2. If your cient side DataPortal is configured to use MobileFormatter the I would expect to get that exception. 
    3. Make sure that none of your code actually uses List<T> directly - I would recommend to use the builtin list types in CSLA for business objects.

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    5 Posts
    Riz replied on Mon, Feb 3 2014 10:11 AM

    Hi Jonny.

    We have some more questions for you and need your suggestion on them as well, as told earlier we are currently using CSLA version 2.1.4. So what path shall we follow while we upgrade to higher CSLA versions?

    Shall we first upgrade the csla version to 3.5.3, as after going through some of the CSLA forum links we found that upgrading the CSLA version from 2.1.4 to 3.5.3 is not that much tough than directly upgrading to higher versions than 3.5.3. What is your though t on this?

     Is it really simpler to upgrade till version 3.5.3 than directly upgrading to versions 3.8.3 OR 4.0 and above csla versions?

     

    As in our case there are lots of BO classes where we need to modify the code if there are any major changes while upgrading the CSLA version. Please advice, so that we can follow the proper steps for upgrading the csla version.

    Top 10 Contributor
    2,279 Posts

    Well, it's been awhile since I worked on version 2 and 3. 

    You definitely have a lot of work to move to CSLA 4.x as all properties must be changed to have PropertyInfo and you _should_ also rewrite all your custom business rules to be classes for the v4 RuleEngine. 

    So assuming you do not want to do all that you can only move up to CSLA 3.5 or newer with relatively small efforts. 

    As I said - it has been a while since I worked on those version - but I would try to go to CSLA 3.8.3 and get all the bugfixes and improvements done so far. 

    You should also read the change log for each version as this provides details on breaking changes that you may hit. 

     

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Page 1 of 1 (6 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