2010-01-15 55 views
0
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(@"CustomControls.Nav.dll"); 
//Namespace and assembly name are CustomControls.Nav , the class name for the control is WebBar 
Type type = assembly.GetType("CustomControls.Nav.WebBar"); 

我得到的類型爲null.What我做錯了嗎?正在加載自定義服務器控件

+0

我知道愚蠢的問題,但程序集返回null。該dll是否包含該類型?你能通過對象查看器查看它嗎? – 2010-01-15 15:45:14

+0

我可以在調試器中看到它不是空的,但是下一行是assembly.GetType(「」)返回null – chugh97 2010-01-15 16:23:27

+0

您是否正確拼寫類型的名稱? – 2010-01-15 16:49:14

回答

0

當你看這個大會時,對象瀏覽器會顯示什麼?它顯示CustomControls.Nav.WebBar嗎?

相關問題