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

  1. On the Debug menu in Visual Studio, click Exceptions to open the Exceptions dialog.

  2. In the Break when an exception is: window, click the Thrown checkbox next to the Common Language Runtime Exceptions option.

  3. 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

  1. On the Debug menu in Visual Studio, click Exceptions.

  2. In the Exceptions dialog, click the most appropriate category for your exception, and then click Add.

  3. In the New Exception dialog, select the exception Type and type the fully qualified exception name.

  4. Click OK.

  5. In the Break when an exception is: window under the category you selected earlier, click the new exception name.

  6. Click the Thrown checkbox next to the new exception name.

  7. Click OK to apply your changes.

See Also