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

19

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.

c#
assembly-resolution
asked on Stack Overflow Feb 15, 2011 by HuseyinUslu • edited May 23, 2017 by Community

2 Answers

5

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)

answered on Stack Overflow May 21, 2012 by Soundararajan • edited Feb 17, 2018 by Soundararajan
0

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.

answered on Stack Overflow Jul 20, 2016 by Micah Vertal

User contributions licensed under CC BY-SA 3.0