我正在努力将32位Web应用程序迁移到64位,并且我的插件加载器代码存在一些问题.
在32位版本中,我们扫描所有.net dll的webapps bin目录,然后加载它们Assembly.Load以检查我们的插件属性是否存在.
我们使用公共域代码以相当漂亮的方式完成了这项工作:
/// <summary>
/// Returns true if the file specified is a real CLR type,
/// otherwise false is returned.
/// False is also returned in the case of an exception being caught
/// </summary>
/// <param name="file">A string representing the file to check for
/// CLR validity</param>
/// <returns>True if the file specified is a real CLR type,
/// otherwise false is returned.
/// False is also returned in the case of an …Run Code Online (Sandbox Code Playgroud)