AmbiguousMatchFound in SL application

AmbiguousMatchFound in SL application

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


KevinKlasman posted on Monday, March 22, 2010

As I said in a previous post, I'm trying to write a simple SL4 application that loads a read only list. I'm following the Rolodex SL sample (which runs), VS2010 Beta 2, SL4 beta, CSLA 3.8.2.

I copied the WcfHostWeb project from Rolodex and added it to my solution. I changed the port numbers , assembly name and default namespace so there wouldn't be any conflict. Is this sufficient or did I skip something important here (I'm not a web developer, so I don't know what I don't know.)

I'm using the conditional compilation strategy used in the Rolodex sample.

I have set the proxy type to SynchronizedWcfProxy an App.xaml.cs, again, just like the Rolodex solution.

Stepping through both applications I get to SynchronizedWcfProxy.RunSynchronized and call worker.RunWorkerAsync(). The calls stack look very similar.

 > Csla!Csla.DataPortalClient.SynchronizedWcfProxy<BusinessLogic.ReadOnlyIntellifolders>.RunSynchronized(System.Delegate method = {System.Action}, object[] arguments = {object[0]}) Line 255 C#
  Csla!Csla.DataPortalClient.SynchronizedWcfProxy<BusinessLogic.ReadOnlyIntellifolders>.BeginFetch() Line 74 C#
  Csla!Csla.DataPortal<BusinessLogic.ReadOnlyIntellifolders>.BeginFetch() Line 187 + 0x45 bytes C#
  BusinessLogic!BusinessLogic.ReadOnlyIntellifolders.GetReadOnlyIntellifolders(System.EventHandler<Csla.DataPortalResult<BusinessLogic.ReadOnlyIntellifolders>> handler = {System.EventHandler<Csla.DataPortalResult<BusinessLogic.ReadOnlyIntellifolders>>}) Line 52 + 0xb bytes C#
  [Native to Managed Transition] 
  [Managed to Native Transition] 
  Csla!Csla.Reflection.MethodCaller.CallFactoryMethod(System.Type objectType = {BusinessLogic.ReadOnlyIntellifolders}, string method = "GetReadOnlyIntellifolders", object[] parameters = {object[1]}) Line 308 + 0xf bytes C#
  Csla!Csla.Silverlight.CslaDataProvider.Refresh() Line 408 + 0x2b bytes C#
  Csla!Csla.Silverlight.CslaDataProvider.Data.get() Line 210 C#
  [Native to Managed Transition] 
  [Managed to Native Transition] 
  System.Windows.dll!System.Windows.CLRPropertyListener.Value.get() + 0x32 bytes 
  System.Windows.dll!System.Windows.PropertyAccessPathStep.ConnectToPropertyInSource(bool isSourceCollectionViewCurrentItem) + 0x231 bytes 
  System.Windows.dll!System.Windows.PropertyAccessPathStep.ConnectToProperty() + 0x35 bytes 
  System.Windows.dll!System.Windows.PropertyAccessPathStepDescriptor.CreateStep(System.Windows.PropertyPathListener listener, object source, bool listenToChanges) + 0x40 bytes 
  System.Windows.dll!System.Windows.PropertyPathListener.ConnectToSource(System.Windows.PropertyPath path = {System.Windows.PropertyPath}, object source, bool listenToChanges = true) + 0x3a bytes 
  System.Windows.dll!System.Windows.Data.BindingExpression.ConnectToSource() + 0x4f bytes 
  System.Windows.dll!System.Windows.Data.BindingExpression.OnAttach(System.Windows.DependencyObject d, System.Windows.DependencyProperty dp) + 0x2cf bytes 
  System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp = {System.Windows.CustomDependencyProperty}, object value, bool allowReadOnlySet) + 0x22a bytes 
  System.Windows.dll!System.Windows.Data.BindingOperations.SetBinding(System.Windows.DependencyObject target, System.Windows.DependencyProperty dp, System.Windows.Data.BindingBase binding) + 0xd1 bytes 
  System.Windows.dll!System.Windows.Data.Binding.MS.Internal.IMarkupExtension.SetupExtension(object target, object property) + 0x49 bytes 
  System.Windows.dll!MS.Internal.FrameworkCallbacks.SetBindingForObject(System.IntPtr nativeTarget, string propertyName, uint nKnownIndex, System.IntPtr nativeBinding, string attachedDPOwnerNamespace, string attachedDPOwnerAssembly) + 0xfc bytes 
  [Managed to Native Transition] 
  System.Windows.dll!MS.Internal.XcpImports.Application_LoadComponent(MS.Internal.INativeCoreTypeWrapper componentAsDO, string resourceLocator, System.IO.UnmanagedMemoryStream stream, uint numBytesToRead) + 0x6b bytes 
  System.Windows.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator) + 0x91 bytes 
  MyClxWeb!MyClxWeb.FolderList.InitializeComponent() Line 59 + 0x28 bytes C#
  MyClxWeb!MyClxWeb.FolderList.FolderList() Line 21 + 0x8 bytes C#
  MyClxWeb!MyClxWeb.App.Application_Startup(object sender = {MyClxWeb.App}, System.Windows.StartupEventArgs e = {System.Windows.StartupEventArgs}) Line 30 + 0x15 bytes C#
  System.Windows.dll!MS.Internal.CoreInvokeHandler.InvokeEventHandler(int typeIndex, System.Delegate handlerDelegate, object sender, object args) + 0x991 bytes 
  System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex, string eventName) + 0x2e4 bytes 
  [Appdomain Transition] 

However, when worker.RunWorkAsync is executed, I never get into my BO's DataPortal_Fetch method and ultimately end up with Ambiguous match found error. What is the ambiguous method? I can see in the call stack references to my Read only list's factory method (GetReadOnlyIntellifolders). Given that this method appears in both the server BO assembly and the client BO assembly, is this the ambiguous match?

I've been stumped on this for days now...

Thanks,

Kevin

RockfordLhotka replied on Monday, March 22, 2010

This exception typically comes when the data portal can't get .NET to uniquely identify the right method to invoke. And that means you probably don't have an exact match between the parameter type you pass to BeginFetch() and the parameter type on your DataPoral_Fetch() method.

KevinKlasman replied on Monday, March 22, 2010

Thanks Rocky...that was it.

Copyright (c) Marimer LLC