CSLA and the .NET 4.0 Client Profile

CSLA and the .NET 4.0 Client Profile

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


jsimas posted on Saturday, October 31, 2009

Hi,

I am using CSLA for a WPF application and I am planning to take advantage of the reduced footprint of the Client Profile of the upcoming .NET 4.0.

As it is now, CSLA does not compile for that target so I applied a bit of brute force to make it compile (using 3.8 Beta 3):

1. Opened the CSLA.sln in VS2010 Beta 2 and went through the conversion successfully.
2. Changed the target to .NET Framework 4 Client Profile
3. Deleted the folders Web and Workflow
4. In CommonRules, deleted the Data Annotations region
5. In ValidationRules, deleted the Data Annotations region
6. In Core.BusinessBase, deleted the body of the method AddBusinessRules (which is a single call to ValidationRules.AddDataAnnotations())
7. Added CLIENTONLY to the Conditional compilation symbols in the Build section of the Properties of the project.
8. Removed the following references: System.ComponentModel.DataAnnotations, System.Design, System.Web and System.Workflow.Runtime
9. Replace several references such as PresentationCore and WindowBase with the latest versions.

I only found out about CLIENTONLY after I removed the web and workflow so I don't know if it would have allowed me to skip that step. I will try that on the next iteration.

I applied the same treatment to the tests solution but wasn't so lucky. In the end I managed to get the Basic and the EditableRootList tests to run and pass without any modification on my part. This was mostly due to using MsTest instead of NUnit and lack of time. I expect to be able to run a large proportion of the test suite in the future.

I would like to know what is your opinion on the Client Profile and whether you have any plans to support this scenario. On my part, I will definitely have to support it and I am happy to share the results and code, I just wouldn't want to be duplicating work.

Cheers,
Jose

RockfordLhotka replied on Saturday, October 31, 2009

Yes, CSLA .NET 4.0 will support the .NET 4.0 client profile, either through the CLIENTONLY directive, or by having a completely different project with linked files (much like I do for Silverlight) - I haven't decided which approach to take yet.

Please remember that CSLA .NET 3.8 and earlier may build on .NET 4.0, but they are designed for .NET 3.5 (or whatever version matches the version of CSLA .NET).

jsimas replied on Saturday, October 31, 2009

Hi,

That is great, I will target the full framework until that is in place. Concerning the version, I did not find a CSLA download for .NET 4.0 so I guess it is internal only.

Are you planning to do any beta release before Microsoft releases the final .NET 4 framework next year?

Jose

RockfordLhotka replied on Saturday, October 31, 2009

I'm sure I will do numerous alpha and beta releases before Microsoft
releases .NET 4.0.

Copyright (c) Marimer LLC