我得到了下面的代碼創建一個DLL:GetTypes從DLL?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace Plugin
{
public class QtObject : DependencyObject
{
[...]
}
public class Timer : DependencyObject
{
[...]
}
}
我把DLL,想用這個代碼對其進行自省:
var library = Assembly.LoadFrom(libraryPath);
IEnumerable<Type> types = library.GetTypes();
而且在第二行,我有以下錯誤: 「無法加載一個或多個請求的類型。檢索LoaderExceptions屬性以獲取更多信息。」
據我所知,我應該在我的集合中獲得2個「對象」,對應於我的類沒有?
非常感謝您的幫助。
什麼是'LoaderExpection'財產說呢? –