-1

I am trying to call the Save method from a System.Drawing.Image object, after loading the assembly from the GAC:

_drawingAssembly = Assembly.Load
                    ("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");

_drawingAssembly.GetType("Image").GetMethod("Save").Invoke(myImageObject, new object[] { path });

But it's not working. I can't even get the type for some reason; this returns null:

var t = _drawingAssembly.GetType("Image"); // null
Drake
  • 2,679
  • 4
  • 45
  • 88
  • 1
    You need to have fully qualified name of class while calling `GetType` might be `_drawingAssembly.GetType("System.Drawing.Image")` – Jenish Rabadiya Apr 01 '15 at 13:16

1 Answers1

2

You need to specify the full type name System.Drawing.Image as indicated by the documentation:

https://msdn.microsoft.com/en-us/library/y0cd10tb(v=vs.110).aspx

nodots
  • 1,450
  • 11
  • 19