我正在尝试使用以下代码(它已被反编译):
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
if ((!assembly.FullName.StartsWith("System") && !assembly.FullName.StartsWith("Microsoft")) && !assembly.FullName.StartsWith("mscorlib"))
{
list.Add(assembly.FullName);//keep the name of assembly.
}
}
foreach (string assemblyStirng in list)
{
var assembly = Assembly.Load(assemblyString);//here FileNotFoundException is thrown.
}
这怎么可能?Dll 已经在域中,Assembly.Load 应该返回它。