Silverlight Project using SL4/.NET4/CSLA4.?

Silverlight Project using SL4/.NET4/CSLA4.?

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


RogerWillCode posted on Monday, October 25, 2010

I've used CSLA 3.? to build .NET WPF apps.  I just started venturing into Silverlight.

I purchased the videos and it appears that this approach works for CSLA 3.6/3.8, but not for 4.?

Can I build a 3 tier silverlight app that has the same structure as the Demos in the video without using the Viewmodel object in the new samples?  Or do I have to change the way I do some things?  I have fixed the error regarding the missing WpfPortal by editing my XAML to reflect the updated contract, but I am still not able to fire my fetch in the Server code.  I am getting an unhandled exception thrown by the client GetObject method/callback.

Here is the exception details if that helps: (in Csla.WcfPortal.WcfResponse EndFetch() line 888

System.ServiceModel.CommunicationException was unhandled by user code
  Message=The remote server returned an error: NotFound.
  StackTrace:
       at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
       at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result)
       at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result)
       at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result)
       at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
  InnerException: System.Net.WebException
       Message=The remote server returned an error: NotFound.
       StackTrace:
            at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
            at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       InnerException: System.Net.WebException
            Message=The remote server returned an error: NotFound.
            StackTrace:
                 at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                 at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                 at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
            InnerException:

thanks for any ideas/feedback.

Savij replied on Monday, October 25, 2010

Not sure if its the same error or not, but one thing that got me when I first started in Silverlight and Csla was that my ServiceReferences.ClientConfig that got created when I setup my service reference in my Csla client project had to be copied to my Shell project in order to work. I think it was that error that I got....

Sorry that was Prism speak, by shell project I mean the project that contains your starting view.

-Jeff

RogerWillCode replied on Wednesday, October 27, 2010

Thanks for responding, Jeff, I finally found it.  It was one of those gotchas that elude you for a long time and you kick yourself over and over afterwards.  I used the split file implementation using partial classes and in one of the files, I spelled the class name differently.  So it LOOKED like a server/client communication issue, but it was just actually a hard to find stupid mistake.

Copyright (c) Marimer LLC