-1

In my current undertaking with Sitecore version 10.3.0, I am in the process of extracting data from the reporting API. However, an error has arisen, as illustrated by the screenshot below.

enter image description here

After reviewing the definition of ReportingClient, it becomes evident that the issue may be attributed to the class having an Internal Access Modifier. I need help to mitigate this issue. thanks in advance.

enter image description here

1 Answer 1

0

Well your only immediate option would be to use reflection to invoke it.

ConstructorInfo ctor = GetType("Sitecore.Reporting.Client.ReportingClient").GetConstructors
    (BindingFlags.Instance | BindingFlags.NonPublic)[0];

var reportingClient = ctor.Invoke(new object[] { "test" });

Something along those lines.

That said, this class was likely marked internal for good reason. You should probably check your implementation methodology and look around for a different approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.