Derleyici Hatası CS0127

'function' void döndürdüğünden, return anahtar sözcüğünü bir nesne ifadesi takip etmemelidir

Geçersiz dönüş türüne sahip bir yöntem bir değer döndüremez. Daha fazla bilgi için bkz . Yöntemler.

Aşağıdaki örnek CS0127 oluşturur:

// CS0127.cs  
namespace MyNamespace  
{  
   public class MyClass  
   {  
      public int hiddenMember2  
      {  
         get  
         {  
            return 0;  
         }  
         set   // CS0127, set has an implicit void return type  
         {  
            return 0;   // remove return statement to resolve this CS0127  
         }  
      }  
  
      public static void Main()  
      {  
      }  
   }  
}