現在、レイト バインディングの章で C# を学習しています。テスト用に次のように記述しましたが、 MissingMethodExceptionが生成されます。カスタム プライベート DLL をロードしてメソッドを正常に呼び出した後、GAC DLL で同じことを実行しようとしましたが、失敗しました。
次のコードの何が問題なのかわかりません。
//Load the assembly
Assembly dll = Assembly.Load(@"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ");
//Get the MessageBox type
Type msBox = dll.GetType("System.Windows.Forms.MessageBox");
//Make an instance of it
object msb = Activator.CreateInstance(msBox);
//Finally invoke the Show method
msBox.GetMethod("Show").Invoke(msb, new object[] { "Hi", "Message" });