
Not able to send arguments from javascript to reflection object methods.

Hi, I am working on a project to embed edge chromium in c# windows application. In this application I am trying to add reflection objejct for scripting but not able to receive method arguments from javascript.
- I follwed this link for AddHostObjectToScript which is working if we add direct class object. - https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addhostobjecttoscript?view=webview2-dotnet-1.0.902.49
- I have class called DynamicPluginRouter which implements interface IReflect like
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class DynamicPluginRouter : IReflect
{
public object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{
}
}
-I created object and created delegate methods for the above clases and added object like
_webBrowser.CoreWebView2.AddHostObjectToScript("ChromeBrowser", dynamicPluginObject);
- I am trying to call method from javascript like chrome.webview.hostObjects.sync.ChromeBrowser['GetCustomerID'] for this I am able to getting into Invokemember method and able execute.
- Trying to call method with parameter like
chrome.webview.hostObjects.sync.ChromeBrowser.['SetCustomerID'] .apply(null,argumentsList); I am getting null for args in the Invokemember.
Can anyone help me on this. How to add reflection object to edge chromium for scripting?
Thanks
Vinodh Kumar