Yeah that's interesting actually.
If you box the struct first it works, eg.

 1 public struct test
 2 {
 3     public string name;
 4 }
 5 
 6 static void Main()
 7 {
 8     test t = new test();
 9     FieldInfo fi = t.GetType().GetField("name");
10     object p = (object)t;
11     fi.SetValue(p, "blah");
12     = (test)p;
13     Console.WriteLine(t.name);
14     Console.ReadLine();
15 }
16 

 

posted on 2010-01-19 14:05  天涯海阁  阅读(127)  评论(0)    收藏  举报