How to: Handle Exceptions
To ensure that you handle exceptions properly, you must know which part of the system threw the exception and why. Forefront Identity Manager Synchronization Service (FIM Synchronization Service), the operating system, and the Microsoft .NET Framework can all throw exceptions. You can start the Microsoft Visual Studio debugger whenever an exception is thrown to determine if you must handle that particular exception.
The following procedures show how to configure the Visual Studio debugger to start on any exception, or on a specified exception. Before you perform the following procedures, attach the debugger to the FIM Synchronization Service process. For more information, see How to: Attach the Visual Studio Debugger to the Process.
To start the Visual Studio debugger on any exception
On the Debug menu in Visual Studio, click Exceptions to open the Exceptions dialog.
In the Break when an exception is: window, click the Thrown checkbox next to the Common Language Runtime Exceptions option.
Click OK to apply your changes.
You can also start the debugger when a specified exception is thrown by adding the fully qualified exception name to the appropriate category of Exceptions in Visual Studio.
To start the debugger on a specified exception
On the Debug menu in Visual Studio, click Exceptions.
In the Exceptions dialog, click the most appropriate category for your exception, and then click Add.
In the New Exception dialog, select the exception Type and type the fully qualified exception name.
Click OK.
In the Break when an exception is: window under the category you selected earlier, click the new exception name.
Click the Thrown checkbox next to the new exception name.
Click OK to apply your changes.
See Also
Concepts
Testing and Debugging Rules Extensions
Using Rules Extensions
How to: Attach the Visual Studio Debugger to the Process