Hi everyone,
We been using Csla from v2.0 in Web/Windows application. Now we decided to move some of our Web_App use case to Silverlight. We downloaded current 4.5.30 framework version and trying to run PagedList application under silverlight/cs folder. Application got compiled ok, but it is generation exception on line 44 [DalaList.cs -> DataPortal.BeginFetch<DataList>(new PagedCriteria(0, 10, true), callback);] , as folows
Csla.DataPortalException: DataPortal.Fetch failed (DataList.DataPortal_Fetch not implemented) ---> Csla.Reflection.CallMethodException: DataList.DataPortal_Fetch method call failed ---> System.NotImplementedException: DataList.DataPortal_Fetch not implemented
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Csla.Reflection.LateBoundObject.<CallMethodTryAsync>d__3.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at Csla.Server.SimpleDataPortal.<Fetch>d__7.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Csla.DataPortal`1.<BeginFetch>d__1e.MoveNext()
The call is going to ObjectFactory class in PagedListDal.cs or if someone know how to debug the code when running async under background thread.
We kind of stuck in between, if some one had got through this exception before or anyone had tested this application before. An early response would be appreciated.
Hi,
I have not tried to run this specific sample but, from my understanding:
- does page list contains a DataPortal_Fetch method with a PagedCriteria signature
- is your client/server settings setup correctly: this method might not be present in the Silverlight code / only available in the server code, and the local portal might be configured.
Regards,
Gilles
Thanks Gillies the response, DataList is configured to use ObjectFactory, DataListDal. Aslo App is configured to use WcfDataPortal and its setting are put in ServiceReferences.clientconfig file. So what i assume, when dp.Beginfetch call starts, it should run on bg thread, and on server side control should move in DataListDal.Fetch method. I also commented out the ObjectFactory attribute, and put my own DataPortal_Fetch method in DataList.server file, but result is the same exception.
Regards.
Asad Cheema.
Also when we debug into Csla code, (line 76-Csla.server.DataPortalSelector - > context.FactoryInfo = ObjectFactoryAttribute.GetObjectFactoryAttribute(objectType);) returning null, even though ObjectFactory attribute is defined as follows in DataList.cs (in Library.Net)
#if !SILVERLIGHT
[Csla.Server.ObjectFactory("DataAccess.DataListDal,DataAccess")]
#endif
So it looks like ObjectFactory Attribute is not reading by the framework correctly, thats why it is looking local DataPortal_Fetch method.
Any help to resolve this is appreciated. Thanks in advance.
Asad.
And further debugging the sample app, looks like when bw.RunWorkerAsync(); statement executes, it is still looking DataPortal_XYZ in client's dll i.e. Library.Silverlight. Obviously ObjectFactoery is not defined there.
Any this we missed in WcfDataPortal configuration to goto Remoteserver?
Regards.
Asad Cheema.
Hi,
Unfortunately this sample hasn't been updated to run in CSLA 4.5.x
The basic necessary steps to get it running is:
DataList.cs:
[ObjectFactory("DataAccess.DataListDal, DataAccess")] [Serializable] public class DataList : BusinessListBase<DataList, DataItem>
App.Xaml
private void Application_Startup(object sender, StartupEventArgs e) { Csla.ApplicationContext.DataPortalProxy = typeof(Csla.DataPortalClient.WcfProxy).AssemblyQualifiedName; Csla.ApplicationContext.DataPortalUrlString = "http://localhost:29082/WcfPortal.svc"; this.RootVisual = new MainPage(); }
WcfPortal.cs:
<% @ServiceHost Service="Csla.Server.Hosts.Mobile.WcfPortal" %>
web.config
<service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Mobile.WcfPortal"> <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Mobile.IWcfPortal">
Thanks jonny, it worked. That App.Xml settings were not there, i was assuming Silverlight will be setting up using ServiceReferences.ClientConfig.
Anyway thanks again. I assume same kind of changed will be required to execute other samples too.
Regards.
Asad Cheema.
Copyright (c) Marimer LLC