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 CS0149

Method name expected

When creating a delegate, specify a method.

The following sample generates CS0149:

using System;
delegate string func(int i);   

class a {
   static func dt;   // class member-field of the declared delegate type
   public static void Main() {
      dt = new func(17.45);   // CS0149
      // try the following line instead
      // dt = new func(func2);
      x(dt);
   }

   public static string func2(int j) {
      Console.WriteLine(j);
      return j.ToString();
   }

   public static void x(func myFunc) {
      myFunc(8);
   }
}