text: Q:
  
  Setting the value of a read only property in C#
  
  I'm trying to make a mod for a game in c# and I'm wondering if there's a way to change the value of a read only property using reflections.
  
  A:
  
  In general, no.
  Three examples:
  public int Value { get { return _value + 3; } } // No
  
  public int Value { get { return 3; } } // No
  
  public int Value { get; private set; } // Yes
  
  So, you can change the value of the property while this property has corresponding private, protected or internal field.
  
  A:
  
  Try this:
  typeof(foo).GetField("bar", BindingFlags.Instance|BindingFlags.NonPublic).SetValue(foo,yourValue)
  
  A:
  
  You can in both those scenarios:
  readonly int value = 4;
  
  and
  int value {get; private set}
  
  using 
  typeof(Foo)
     .GetField("value", BindingFlags.Instance)
     .SetValue(foo, 1000); // (the_object_you_want_to_modify, the_value_you_want_to_assign_to_it)
  
  You cannot modify 
  int value { get { return 4; } }
  
  though.
  If it returns a calculated value like
  int value { get { return _private_val + 10; } }
  
  you would have to modify _private_val accordingly.
  
  