我是第一次使用 dotfuscator。我的项目是用 C# 和 .NET 3.5 编写的,它有一个主程序和一些插件;这是加载插件的代码片段:
// Load the file
Assembly asm = Assembly.LoadFile( pluginPath );
// Instantiate the types I need
foreach( Type type in asm.GetTypes() )
{
...
}
现在的问题是:如果我不混淆一切都很好但是当我使用 dotfuscator 时asm.GetTypes()
抛出一个 ReflectionTypeLoadException 它说
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
我用谷歌搜索了几个小时没有结果。提前致谢。
编辑:经过一些研究和调试,我认为这是清单中的一个问题,因为反射无法看到(或加载)程序集中的类型。我用 Reflector 打开了混淆程序集,但一切似乎都很好。