我将所需的程序集嵌入到我的项目中,并在运行时使用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)
基本上我怀疑 CLR无法使用 Assembly.Load(byte[]) 加载混合模式程序集,但我不确定。
我找不到与异常消息相关的任何内容;
尝试使用修正加载无法验证的可执行文件(IAT 具有超过 2 个部分或 TLS 部分。)
帮助表示赞赏。