When I am debugging the below code block, I am getting System.ArgumentNullException .
public string StartDeviceDiagnosis(DiagnosticsOption diagnosticsOption)
{
var aggregator = ServiceProviderHandle.ServiceProvider.GetService<**IAggregator**>();
this.CreateDeviceStatusReport(DiagnosticConstant.DeviceStatusReportHTMLFileName);
return aggregator.AggregateLogs(diagnosticsOption, true);
}
System.ArgumentNullException: 'Value cannot be null. Parameter name: provider'
I tried adding try-catch block to handle the exception, but I wasn't able to do that as the method has to return a string.