New Posts New Posts RSS Feed: Silverlight IConnectionOptionsResolver
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Silverlight IConnectionOptionsResolver

 Post Reply Post Reply
Author
halloweenx8 View Drop Down
Newbie
Newbie
Avatar

Joined: 07-Sep-2012
Location: Longueuil, QC
Posts: 36
Post Options Post Options   Quote halloweenx8 Quote  Post ReplyReply Direct Link To This Post Topic: Silverlight IConnectionOptionsResolver
    Posted: 14-Sep-2012 at 3:43pm
Hi
 
Im trying to authenticate a user using AuthenticationService and an implementation of IEntityLoginManager
My users have different database so I had to implement IDataSourceKeyResolver, all this works using aspx pages, but when i try the same thing in Silverlight i get this error
 
{System.MethodAccessException: Attempt by method 'Microsoft.Internal.ReflectionInvoke.SafeInvoke(System.Reflection.ConstructorInfo, System.Object[])' to access method 'ClientService.Authentication.DealerliveConnectionOptionsResolver..ctor()' failed.
   at IdeaBlade.EntityModel.CoroutineOperation.HandleError(INotifyCompletedArgs notifyCompletedArgs)
   at IdeaBlade.EntityModel.CoroutineOperation.OnCompleted(INotifyCompletedArgs notifyCompletedArgs)
   at IdeaBlade.EntityModel.CoroutineOperation.OnError(Exception error)
   at IdeaBlade.EntityModel.CoroutineSerialProcessor.Process()
   at IdeaBlade.EntityModel.CoroutineProcessor.Start()
   at IdeaBlade.EntityModel.Coroutine.Start(Func`1 coroutine, Action`1 completedHandler)
   at Cocktail.AuthenticationService.LoginAsync(ILoginCredential credential, Action onSuccess, Action`1 onFail)
   at DealerLive.MainPage.Login()
   at DealerLive.MainPage..ctor()
   at DealerLive.App.Application_Startup(Object sender, StartupEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}
 
Any help will be appreciated, thanks
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”
Back to Top
halloweenx8 View Drop Down
Newbie
Newbie
Avatar

Joined: 07-Sep-2012
Location: Longueuil, QC
Posts: 36
Post Options Post Options   Quote halloweenx8 Quote  Post ReplyReply Direct Link To This Post Posted: 15-Sep-2012 at 8:25pm
Anybody, any ideas?
Jean

"If You are Not Making Mistakes, then You are Not Doing Anything.”
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 16-Sep-2012 at 6:29pm
Hi Jean,
 
This is actually a Cocktail issue, not a DevForce issue per se, and Marcel is traveling right now.  I can try to help, but you may need to repost this in the Cocktail section of the forum to ensure Marcel sees it.
 
My first guess at why you'd get a MethodAccessException when looking for your DealerliveConnectionOptionsResolver constructor is that you don't have a public parameterless constructor defined for the class.  If you do, or don't have any constructors defined, then my next thought would be the class definition.  Reflection in Silverlight works only with public types and members, or internal types and members if you explicitly grant access.
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2012 at 2:22pm
Jean,
ConnectionOptionsResolvers are created through MEF. As Kim says, your class needs to be public and have a public default ctor or alternatively a public ctor marked with the ImportingConstructorAttribute if you wish to inject dependencies.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down