Exception with Resolving assemblies: Attempt to load an unverifiable executable with fixups

老子叫甜甜 提交于 2019-12-18 18:47:21

问题


I'm embedding required assemblies to my project and resolving them on runtime with AppDomain.CurrentDomain.AssemblyResolve event.

All works okay except irrKlang's .net4-wrapper, which throws an exception if i try so;

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)

Basicly i suspect of CLR not being able to load mixed mode assemblies with Assembly.Load(byte[]) though i'm not sure.

I was not able to find anything related to the exception message;

Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.)

Help appreciated.


回答1:


EDIT : The references i posted are not valid anymore, because of outdated external links. Please refer here. How do I dynamically load raw assemblies that contains unmanaged code?(bypassing 'Unverifiable code failed policy check' exception)




回答2:


Just in case anyone else is having my version of this problem, here's how I fixed it:

  • Create a new project with a different name
  • Copy all of your files into the new project (including code)
  • Add references to all the files necessary to compile without errors

I really must have messed something up with my references/resources. I was getting this error when trying to load any external .dll from my program.



来源:https://stackoverflow.com/questions/5005409/exception-with-resolving-assemblies-attempt-to-load-an-unverifiable-executable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!