Hi Experts!
I'm customizing a class right now specifically the BusinessEventsWorkFlowWorkItem class wherein I need to access a private variable in the buildContract(). So basically I am accessing the private variable using a hack -> using System.Reflection and using the code below:
public void exposePrivateVariable()
{
var bindFlags = BindingFlags::Instance | BindingFlags::NonPublic;
var buffer = this.GetType().GetField("nameOfThePrivateVariable", bindFlags);
if (buffer)
{
nameOfThePrivateVariableTableBuffer = buffer.GetValue(this);
}
}
Basically this is not accepted especially with the current AppChecker: https://github.com/microsoft/Dynamics365FO-AppChecker
Are there any other ways to get through this?