NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS1015

An object, string, or class type expected

An attempt was made to pass a predefined data type into a catch block. Only data types that derive from System.Exception can be passed into a catch block.

The following sample generates CS1015:

using System;
namespace x {
   public class b : Exception {
   }
   public class a {
      public static void Main() {
         try {
         }
         catch(int) {   // CS1015, int not derived from System.Exception
         }
      }
   }
}

See Also

Exception Handling Statements