解决程序集的exception:尝试使用fixup加载无法validation的可执行文件

我正在将所需的程序集嵌入到我的项目中,并使用AppDomain.CurrentDomain.AssemblyResolve事件在运行时解析它们。

一切正常,除了irrKlang的.net4-wrapper,如果我这样做会引发exception;

 System.IO.FileLoadException: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource) at System.Reflection.Assembly.Load(Byte[] rawAssembly) at xyz.Utility.Helpers.AssemblyManager.Resolver(Object sender, ResolveEventArgs args) in C:\Users\shalafi\Desktop\xyz\trunk\xyz\Utility\Helpers\AssemblyManager.cs:line 55 at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) 

基本上我怀疑CLR 无法使用Assembly.Load(byte []) 加载混合模式程序集 ,虽然我不确定。

我无法找到与exception消息相关的任何内容;

尝试使用fixups加载无法validation的可执行文件(IAT包含2个以上的部分或TLS部分。)

帮助赞赏。

编辑:由于过时的外部链接,我发布的参考不再有效。 请参考这里。 如何动态加载包含非托管代码的原始程序集?(绕过“无法validation的代码失败的策略检查”exception)

以防其他人有我的这个问题的版本,这是我如何修复它:

  • 使用其他名称创建新项目
  • 将所有文件复制到新项目中(包括代码)
  • 添加对编译所需的所有文件的引用,没有错误

我真的必须搞清楚我的参考/资源。 尝试从我的程序加载任何外部.dll时出现此错误。