2015-04-01 59 views
-1

加載我想調用從System.Drawing.Image對象Save方法,從GAC加載程序集後:與組裝調用方法從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 }); 

但它不工作。由於某種原因,我甚至無法獲得該類型;返回null:

var t = _drawingAssembly.GetType("Image"); // null 
+1

你需要有一流的全名,而調用'GetType'可能'_drawingAssembly.GetType(「System.Drawing.Image」)' – 2015-04-01 13:16:37

回答