Hus*_*slu 19 c# assembly-resolution
我正在将所需的程序集嵌入到我的项目中,并在运行时使用AppDomain.CurrentDomain.AssemblyResolve事件解析它们.
一切正常,除了irrKlang的.net4-wrapper,如果我这样做会引发异常;
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)
Run Code Online (Sandbox Code Playgroud)
基本上我怀疑CLR 无法使用Assembly.Load(byte [])加载混合模式程序集,虽然我不确定.
我无法找到与异常消息相关的任何内容;
尝试使用fixups加载无法验证的可执行文件(IAT包含2个以上的部分或TLS部分.)
帮助赞赏.
编辑:由于过时的外部链接,我发布的参考不再有效。请在这里参考。 如何动态加载包含非托管代码的原始程序集?(绕过“无法验证代码失败策略检查”异常)