Jordan
Reflection Load Interface Instance
so i am loading plugins from multiple assemblies and i look for types Implementing the IPlugin interface. I then create an instance of that class (i tried both using activator and manual constuctor call) and when a look at the GetType from the instance i get back, i see the IPlugin and IDisposalbe interfaces listed as implemented on the Type Info, but when i try to cast/use the interface methods i simply get an exception or null (System.InvalidCastException: Unable to cast object of type 'TestPlugin.TestPluginClass' to type 'PluginBase.IPlugin'.
9 replies
How to hit internal API with Authentication in Blazor Server
Can anybody help me with this?
I have a api endpoint in my controller:
And i have a Blazor page where i want to invoke that:
I am logged in on my Blazor page and I want to pass along the identity/authentication to the api controller. In my case, the GetUserAsync on the controller side always returns null. I am using the default Identity.Application authentication sheme.
I tried modifing the request header with the data from the IHttpContextAccessor but I didnt get it to work and i dont think this is the way you are supposed to do this.
1 replies