4.0 Preview Questions

4.0 Preview Questions

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


bill2010 posted on Sunday, January 24, 2010

I downloaded the CSLA 4.0 preview bin and samples. I noticed there seems to be 3 versions of CSLA.dll in the bin file... Server, Client, and Silverlight. Is there an explanation on the reason for this?

Also, I tried running the MVVMExperiment sample, but could not find a reference to ViewModel, so it won't compile. Where can I find this?

JonnyBee replied on Monday, January 25, 2010

Hi,

Yes, there is an explanation.
Csla.Core                ==> target NET4 Full
Csla.Client               ==> target NET4 Client Profile
Csla.Silverlight         ==> target Silverlight 4

So, what we should be prepared for is a scenario of client applications running run in .NET 4 Client Profile (without serverside technologies like ASP.NET) whilst the server applications will need .NET 4 Full.

The MVVMExperiment sample is not yet updated for CSLA 4.0 - and still references CSLA 3.8 (target .NET 3.5).

Quote from blogpost http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx

"In .NET Framework 4 we have introduced a streamlined subset and more compact version of the .NET Framework called the Microsoft .NET Framework 4 Client Profile (aka NET4 Client Profile).
The Microsoft .NET Framework 4 which is the Full Framework (aka NET4 Full) still exists and it is a superset of the Client Profile.

The Client Profile is smaller in size and its goal is to improve the deployment size, time, reliability and overall deployment experience for client applications.

The Client Profile contains the functionality that most common desktop client applications (including Windows Forms and WPF applications) would need, so we expect that many client application developers will target it. This will improve the overall application deployment experience when the application requires .NET Framework 4 to be installed.

When to use NET4 Client Profile and when to use NET4 Full Framework?

    Client Profile:
    We recommend that the NET4 Client Profile be utilized as the primary framework for most client desktop applications (including Windows Forms and WPF apps).
    Since we are considering to make the NET4 Client Profile available broadly to desktops via Windows Update, most client desktops may have NET4 Client Profile soon after NET4 releases making it ubiquitous*.
    Until that time, NET4 apps can chain-install the NET4 Client Profile which is smaller and faster to install.

   *Note: This plan is not final."

bill2010 replied on Monday, January 25, 2010

Good to know. I JUST started looking at .NET 4.0 and wasn't aware of the various flavors. I'm a little uncomfortable that they seem to be tentative.

RockfordLhotka replied on Monday, January 25, 2010

The client profile came in .NET 3.5, but was little-used for various reasons.

In .NET 4.0 the client profile is more mature and I am not worried that it will be tentative. Given the late stage of the process (this is in Beta 2 with a go-live license after all), it would take a major problem for them to change now.

Smart client projects all default to using the client profile - WPF, Windows Forms, etc. Because of this, CSLA needs to have a client-profile-compatible version that can be referenced by those projects.

Of course it still needs a full-.NET version for web app development, which is really the only common project type left that still uses full .NET.

The biggest change from 3.5 to 4.0 is that it is actually possible to deploy only the client profile to a target workstation. In 3.5 if you installed the client profile, Microsoft Update would automatically pull down the rest of .NET. But in 4.0 if you install the client profile, that's all that machine may ever have. Unless the user later installs another app that requires full .NET, they may never have full .NET on the machine.

So it is in all of our best interest to target the right profile when building apps, and specifically to try to stick with the client profile when building smart client apps.

Of course I'm of the opinion that most smart client apps going forward should be written in Silverlight - which is basically a third profile (so we have client, full, Silverlight).

bill2010 replied on Tuesday, January 26, 2010

JonnyBee:
The MVVMExperiment sample is not yet updated for CSLA 4.0 - and still references CSLA 3.8 (target .NET 3.5

I downloaded version 3.8.2 and still get compile errors.

For example, here are a couple of solutions that threw compile errors:

Error 2 The tag 'Execute' does not exist in XML namespace 'clr-namespace:Csla.Wpf;assembly=Csla'. Line 24 Position 14. C:\Users\Bill\Documents\Visual Studio 2008\Projects\CSLA 3.8.2\CslaNet\cs\MVVMexperimentWpf\MVVMexperiment\DetailPage.xaml 24 14 MVVMexperiment
Error 3 The tag 'Execute' does not exist in XML namespace 'clr-namespace:Csla.Wpf;assembly=Csla'. Line 27 Position 14. C:\Users\Bill\Documents\Visual Studio 2008\Projects\CSLA 3.8.2\CslaNet\cs\MVVMexperimentWpf\MVVMexperiment\ListPage.xaml 27 14 MVVMexperiment

Error 1 The type or namespace name 'Range' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Bill\Documents\Visual Studio 2008\Projects\CSLA 3.8.2\cslatest\Csla.Test\DataAnnotations\DataAnnotationsTests.cs 130 6 Cslacs.Test
Error 2 'RangeAttribute' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.RangeAttribute' and 'NUnit.Framework.RangeAttribute' C:\Users\Bill\Documents\Visual Studio 2008\Projects\CSLA 3.8.2\cslatest\Csla.Test\DataAnnotations\DataAnnotationsTests.cs 130 6 Cslacs.Test

Also, I can't find CslaLight in the version 3.8.2 samples.

RockfordLhotka replied on Tuesday, January 26, 2010

CSLA .NET for Silverlight is its own download from

www.lhotka.net/cslalight/download.aspx

You need to download and build the framework, then download and build the samples.

You should make sure to follow the recommended folder structure, as the assembly references use relative paths. If you don't follow the recommended folder structure you'll need to remove/re-add all the Csla.dll references.

You also must have .NET 3.5 SP1 and SL3 installed of course. The DataAnnotations assembly was introduced in .NET 3.5 SP1 and SL3.

Copyright (c) Marimer LLC