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
  • csla upgrade questions

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 21 Replies | 3 Followers

    Not Ranked
    1 Posts
    John Jiang posted on Tue, Dec 3 2013 8:19 AM

    We had an asp.net web application developed in csla (3) with visual studio 2008, aps.net 3.5 C#

    Now we want to upgrade it to aps.net 4 or 4.5 with vs2010 or later.

    Questions:

    1.       Can current csla (3) be able to update directly with vs2010 or later without any changing?

    2.       If we want to upgrade to csla 4 or later with vs2010, what needs to be changed? Any instructions?

     

    Thanks

    John

    Answered (Verified) Verified Answer

    Top 10 Contributor
    9,475 Posts
    Verified by John Jiang

    As long as you don't want to use any of the new features of .NET 4 or 4.5 or the new features of the C# compiler then yes, you should be able to keep using CSLA .NET version 3.0.5.

    Disclaimer: I haven't actually _tried_ to do this, but I've heard from other people that version 3 will continue to work.

    The thing is that most people upgrade to newer versions of .NET and/or C# to get access to new features, such as async/await, ASP.NET MVC, etc. And if that's your goal then you'll need to use more current versions of CSLA .NET that support these newer platform and language features.

    Rocky

    All Replies

    Top 10 Contributor
    9,475 Posts
    Verified by John Jiang

    As long as you don't want to use any of the new features of .NET 4 or 4.5 or the new features of the C# compiler then yes, you should be able to keep using CSLA .NET version 3.0.5.

    Disclaimer: I haven't actually _tried_ to do this, but I've heard from other people that version 3 will continue to work.

    The thing is that most people upgrade to newer versions of .NET and/or C# to get access to new features, such as async/await, ASP.NET MVC, etc. And if that's your goal then you'll need to use more current versions of CSLA .NET that support these newer platform and language features.

    Rocky

    Not Ranked
    8 Posts

    I have a similar issue. My whole solution targets 4.5 but CSLA component remains 3.5. I am not able to login to the application. I'm not able to download CSLA 4.5 from NuGet as it says my framework targets 3.5. 

    Top 10 Contributor
    2,279 Posts

    That is because CSLA 4.5 only supports .NET 4.5 and .NET 4.0.

    Jonny Bekkum, Norway CslaContrib Coordinator

    Top 10 Contributor
    2,279 Posts

    Hi,

    If you are using CSLA 3.6 or later (and use RegisterProperty ) in you bunsiness classes you may also look at my blog post on how to use the new Csla.Validation package to ease migration to CSLA 4.5

    http://jonnybekkum.wordpress.com/2013/10/07/csla-validationthe-new-nuget-package-in-csla-net-4-5-40/

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    8 Posts

    Hi Jonny,

    Forgive me if this is a simple question. If I want to migrate my project to 4.5 but leave my CSLA as 3.5, is that possible without touching the code? And what CSLA version should I use 3.5 or upgrade to 4.5 to be in par with my 4.5 target framework. 

     

    Top 10 Contributor
    2,279 Posts

    Hi,

    You basically keep the existing CSLA assembly references and change the target framework on (retarget) all your assemblies to .NET 4.5

    It is only when you want to use .NET 4.5 specific support in CSLA (like the new rule enging, async/await support in DataPortal etc) that you need the latest CSLA version. 

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    8 Posts

    Hi Jonny,

    My DAL is built separately and they have used CSLA data portal. I followed your example of compiling all the assemblies to 4.5 and still the same problem. Anyway to make this work, got a deadline.

     

    Top 10 Contributor
    2,279 Posts
    JonnyBee replied on Tue, Dec 10 2013 12:30 AM

    Is the client and server build on the same version of .NET?

    Which communication protocol do you use in the DataPortal? (Remoting, ASP.NET Webservice, WCF)

    What is the exception you get?

    Jonny Bekkum, Norway CslaContrib Coordinator

    Top 10 Contributor
    2,279 Posts

    Just for fun - I downloaded the CSLA 3.0.5 for the download page http://www.lhotka.net/cslanet/download.aspx  and: 

     

    • Compiled CSLA 3.0.5 in Visual Studio 2013 and build for .NET 3.5 target
    • Open ProjectTracker samplein Visual Studio 2013
      • retarget all projects to .NET 4.5 
      • add comment on (or remove) all references to PresentationCFFRasterizer in web.config files
      • updated connection string in web.config files to use (LocalDB)v11.0 instance and correct path to .mdf files
      • updated app.config in PtWin to use correct endpoints in services. 
      • and testrun PtWin app with both WcfHost and WebServicesHost just fine!

     

    My changes in PtWin app.config:

      <appSettings>
        <add key="CslaAuthentication" value="Csla"/>
        <!--<add key="CslaDataPortalProxy" 
          value="Csla.DataPortalClient.RemotingProxy, Csla"/>
        <add key="CslaDataPortalUrl" 
          value="http://localhost:3187/RemotingPortal.rem"/>-->
        <!--<add key="CslaDataPortalProxy" 
          value="Csla.DataPortalClient.WebServicesProxy, Csla"/>
        <add key="CslaDataPortalUrl" 
          value="http://localhost:4334/WebServicePortal.asmx"/>-->
        <!--<add key="CslaDataPortalProxy" 
    			 value="EnterpriseServicesHost.EnterpriseServicesProxy, EnterpriseServicesHostcs"/>-->
        <add key="CslaDataPortalProxy" value="Csla.DataPortalClient.WcfProxy, Csla"/>
      </appSettings>
     
      <system.serviceModel>
        <client>
          <endpoint name="WcfDataPortal" address="http://localhost:3564/WcfPortal.svc" binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal"/>
        </client>

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    8 Posts

    Hi Jonny,

    I am testing it on my local machine. 

    Not Ranked
    8 Posts

    And my stack trace:

    [ArgumentNullException: Value cannot be null.
    Parameter name: key]
       System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +14223553
       System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +20
       Csla.Security.ObjectAuthorizationRules.GetRoles(Type objectType) +122
       Csla.Security.AuthorizationRules.GetAllowEditRoles(Type objectType) +59
       Csla.Security.AuthorizationRules.CanEditObject(Type objectType) +107
       Csla.DataPortal.Execute(Type objectType, Object criteria) +1556
       Csla.DataPortal.Execute(Object criteria, Type type) +90
       ASI.MDW.DataAccessLayer.Core.ExceptionLog.ExecuteCommand(ExceptionLogCriteria& criteria) +220
       ASI.MDW.DataAccessLayer.Core.ExceptionLog.LogException(Exception exception, String ipAddress, String agent, String hostName, String url) +150
       MDW2.ExceptionLog.LogException(Exception ex) in C:\My Projects\DEC 6 MDW Migration\MDW\Classes\ExceptionLog.vb:12
       MDW2.Administration.Controls.Logon.ProcessLogon() in C:\My Projects\DEC 6 MDW Migration\MDW\Administration\Controls\Logon.ascx.vb:347
       MDW2.Administration.Controls.Logon.Submit_Click(Object sender, EventArgs e) in C:\My Projects\DEC 6 MDW Migration\MDW\Administration\Controls\Logon.ascx.vb:285
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +153
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
    Top 200 Contributor
    45 Posts

    JonnyBee:

    That is because CSLA 4.5 only supports .NET 4.5.

    Jonny,

    Per the download page, http://www.cslanet.com/Download.html 4.5.30 supports .NET 4. Or is the download page wrong?

    I need to know which version to use with .Net 4.0. I'm migrating from your 3.6.3 N2 version and targeting .Net 4.0.

    I'm also using Winforms UI but those questions will come later after I do some more forum searching...

    Thank you,

    Jeff Young

    Top 10 Contributor
    2,279 Posts

    Hi,

    If you are moving from 3.6 to 4.5 the read my blog post https://jonnybekkum.wordpress.com/2013/10/07/csla-validationthe-new-nuget-package-in-csla-net-4-5-40/  

    On the other hand - you should also be able to just change reference to CSLA 3.6.3 (or newer 3.x) for .NET 3.5 and retarget your project to .NET 4.5 or .NET 4.0 and just recompile with hardly any change in your code. 

    CSLA 3.6.3 N2 has a reference to LinqBridge (to get linq 2 objects in .NET 2.0) that you must make sure to remove from your projects references. And CSLA 3.6.3 N2 is for .NET 2.0 only. If you are on .NET 3.5 the use the official release for .NET 3.5.

    And CSLA 4.5 does support both NET 4.5 and .NET 4.0 but you will need to do a fair amount of changes to move your code from v3.6.3 to v4.5.x and all the new features. 

    Jonny Bekkum, Norway CslaContrib Coordinator

    Top 200 Contributor
    45 Posts

    Jonny,

    Thank you for responding so quickly.

    I don't need the new features yet. I just need to get away from my .Net 2.0 dependency and move it up to .Net 4.0/VS2010. The current code set does no Validation/Business Rules so I don't have to worry about that yet.

    I'm hoping I can swap out 3.6.3 N2 references for .Net 4.5 references and be done for this round. Adding new features to the app can come later.

    JonnyBee:

    And CSLA 4.5 does support both NET 4.5 and .NET 4.0 but you will need to do a fair amount of changes to move your code from v3.6.3 to v4.5.x and all the new features. 

    Just the changes described in your blog post? Or are there others?

    Jeff

     

    Page 1 of 2 (22 items) 1 2 Next > | 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