“Keyword 'this' is not valid in a static property, static method, or static field initializer” when adding methods to an ExpandoObject
问题 I am try to add a dynamic method to ExpandoObject which would return the properties (added dynamically) to it, however it's always giving me error. Is something wrong I am doing here? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Dynamic; namespace DynamicDemo { class ExpandoFun { public static void Main() { Console.WriteLine("Fun with Expandos..."); dynamic student = new ExpandoObject(); student.FirstName = "John"; student.LastName = "Doe"