Xamarin.Android - Setting linker to "Sdk and User Assemblies" causes "Csla Authentication Provider specified does not implement IAuthorizeDataPortal" exception #2911
Replies: 7 comments 5 replies
-
I often wonder about the linker and dependency injection, because so many injected types are never directly referenced or used, and so presumably are candidates for "optimization". I suspect that's what is happening here, is that the default authentication provider type has been optimized away. In CSLA 6 the default authorizer is You could try explicitly specifying the type in the services.AddCsla(o => o
.DataPortal(dp => dp
.AddServerSideDataPortal(sso => sso
.RegisterAuthorizerProvider<Csla.Server.NullAuthorizer>())
.UseHttpProxy(hp => hp.DataPortalUrl = "https://localhost:7289/api/dataportal"))); |
Beta Was this translation helpful? Give feedback.
-
I bet you're right. Since turning off the linker helped, it makes sense what you said. I THINK your example is on the web side. Where would I call |
Beta Was this translation helpful? Give feedback.
-
What I showed is client-side configuration. Any |
Beta Was this translation helpful? Give feedback.
-
Where would I call your example then? What type of object is 'services'? Where should that be called? |
Beta Was this translation helpful? Give feedback.
-
The CSLA 6 upgrade doc might help, especially here: https://github.com/MarimerLLC/csla/blob/main/docs/Upgrading%20to%20CSLA%206.md#xamarinforms-app |
Beta Was this translation helpful? Give feedback.
-
@rockfordlhotka, just calling I'm on 5.5.3 if that matters. I tried this but I can't access NullAuthorizer because it's marked protected. Strangely enough, IntelliSense says that an overload exists. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately for my purposes, this fix has become moot. The linker is also removing references to the Microsoft OpenIdConnect libraries so I just need to keep it to None and be done with it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When the android application first runs, I get an exception in
LoadApplication(new App())
thatCsla Authentication Provider specified does not implement IAuthorizeDataPortal
. This does not happen when the linker is set toNone
.I know that you don't normally use the linker during Debug, but this issue was occurring after a build/release from Azure DevOps so i needed to set the same conditions to reproduce the problem.
Version and Platform
CSLA version: 5.5.3
OS: Android 12
Platform: Xamarin
Stack Trace or Exception Detail
at Csla.Server.DataPortal..ctor (System.Type authProviderType) [0x00036] in <445611070cd74943b7ded50b0f3dc60c>:0
at Csla.Server.DataPortal..ctor (System.String cslaAuthorizationProviderAppSettingName) [0x00007] in <445611070cd74943b7ded50b0f3dc60c>:0
at Csla.Server.DataPortal..ctor () [0x00000] in <445611070cd74943b7ded50b0f3dc60c>:0
at Csla.DataPortalClient.LocalProxy..ctor () [0x00000] in <445611070cd74943b7ded50b0f3dc60c>:0
at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure)
at Csla.Reflection.MethodCaller.CreateInstance (System.Type objectType) [0x0002a] in <445611070cd74943b7ded50b0f3dc60c>:0
at Csla.DataPortalClient.DataPortalProxyFactory.Create (System.Type objectType) [0x000ef] in <445611070cd74943b7ded50b0f3dc60c>:0
at Csla.DataPortal
1[T].GetDataPortalProxy (System.Type objectType, System.Boolean forceLocal) [0x00021] in <445611070cd74943b7ded50b0f3dc60c>:0 at Csla.DataPortal
1[T].GetDataPortalProxy (System.Type objectType, Csla.Reflection.ServiceProviderMethodInfo method) [0x00015] in <445611070cd74943b7ded50b0f3dc60c>:0at Csla.DataPortal`1[T].DoCreateAsync (System.Type objectType, System.Object criteria, System.Boolean isSync) [0x0009a] in <445611070cd74943b7ded50b0f3dc60c>:0
Additional context


Beta Was this translation helpful? Give feedback.
All reactions