- You can set the ProvisioningDataQueryDisabled property to true. This disables the inband query.
- Because UCMA is highly asynchronous, exceptions are sometimes thrown from a worker thread.
When an exception is thrown from a worker thread that is used by UCMA, and the exception is not handled within that worker thread, the exception is not caught. This issue also occurs when the application has a “try or catch” function to handle this type of exception. This issue occurs because the exception occurs in the thread context of the UCMA worker thread instead of the thread context of the user code that is called UCMA.
In order to handle the exception, UCMA has an Exception handler (the UnhandledExceptionManager class) that can be registered in application code for unhandled exceptions in worker threads.
The following code example shows how to register an UnhandledThreadPoolException Handler delegate with the UnhandledExceptionManager class by setting the VerifyAndIgnoreUnhandledThreadPoolException property:The delegate instance is the LogAndIgnoreUncaughtExceptions method of the calling class.The following code example shows how to ignore the exception after you log it:
// Configure UnhandledExceptionManager class to log uncaught exceptions
UnhandledExceptionManager.VerifyAndIgnoreUnhandledThreadPoolException = this.LogAndIgnoreUncaughtExceptions;Note After registering the event, UCMA will pass all unhandled exceptions from worker threads to this event. This will prevent the application from crashing because of this unhandled exception.
bool LogAndIgnoreUncaughtExceptions(Exception ex, WaitCallback method, Object state)
UnhandledExceptionManager class, visit the following Microsoft website: