Handling exceptions

In the previous recipe, we created a list with a custom field and some data. If all of these calls are batched together and sent to the server, how do we handle exceptions? In this recipe, we will create a console application to see how to handle exceptions.

Getting ready

You should complete the previous recipe successfully to follow this one.

How to do it...

In order to handle exceptions, adhere to the following steps:

  1. Launch your Visual Studio 2010 IDE as an administrator (right-click the shortcut and select Run as administrator).
  2. Select File | New | Project. The new project wizard dialog box will be displayed (make sure to select .NET Framework 3.5 in the top drop-down box).
  3. Select Windows console application under the Visual ...

Get Microsoft SharePoint 2010 Development with Visual Studio 2010: Expert Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.