How to use CSLA from Silverlight

How to use CSLA from Silverlight

Old forum URL:

Nemes1s posted on Wednesday, October 26, 2011


I'm creating business application and I have some question for you. I use CSLA 4.1.0 and Silverlight 4. Now, I created WCF and added all my custom classes that refferences CSLA. I added a refference to CSLA.dll. Then, I've went to Silverlight project and tried to add a service refference and everything goes well. But, not everything. Visual Studio 2010 automatically added refferences to CSLA.dll and CSLASilverlight.dll. CSLA.dll is marked as it is not loaded properly with yellow exclamation mark. Then, I checked Reference.cs proxy and it is almost empty. Then, I've made a little research I figured out that the problem is WCF uses CSLA.dll and my silverlight project can't use that one, but can only use CSLASilverlight.dll. No I'm stucked.

So, is any way to use CSLA along side with LingToSQL, WCF and Silverlight?

Update: Just to say that ServiceReferences.ClientConfig file remains empty.

Update: When I use asmx web services it works just fine. Only svc services won't work.


Slobodan Markovic.

RockfordLhotka replied on Wednesday, October 26, 2011

You should read the Using CSLA 4 ebook series, and/or watch the CSLA 4 MVVM video series. They'll answer your questions thoroughly.

If you want to use the data portal like you would from a WPF or Windows Forms client, you don't add a service reference. You just use the existing data portal functionality built into CSLA.

If you want your Silverlight client to be an "edge application" that provides an interface to a service-oriented system, then you'd use the local data portal on the SL client, and you'd add service references to the various services exposed by the other applications in your system.

From your question, it sounds like you want to use the data portal, and that is the easiest solution. Check out the Samples\Net\cs\SimpleNTier sample app, or the Samples\Silverlight\cs\SimpleApp sample - or get the ebook series and read the Using CSLA 4: Data Portal Configuration ebook.

Copyright (c) Marimer LLC