title: Why am I getting ExecutionEngineException on .Net 4.0 Assembly.GetCustomAttributes after installing VS2012/.Net 4.5?
body: <p>As simple as title really.
  I've upgraded a solution from .Net 2-3.5 to .Net 4, it worked fine, I've then installed VS 2012 and with it .Net 4.5 and I'm now getting an ExecutionEngineException when trying to reflect the CustomAttributes from a dynamically generated DLL using the following code:</p>
  
  <pre><code>Assembly assembly = Assembly.LoadWithPartialName("DavesNamespace.Custom");
  var attributes = assembly.GetCustomAttributes(typeof(ChecksumAttribute), true);
  </code></pre>
  
  <p>I get the exception with or without the Type specified for GetCustomAttributes, but it's only at that point that it throws the exception, the assembly is successfully loaded and I can actually view the CustomAttributes collection if I stick a break point in.</p>
  
  <p>The original .Net 2-3.5 version still works since having installed vs2012.</p>
  
  <p>Any help much appreciated, I have found a few issues stemming from vs2012 ending with ExecutionEngineExceptions looking online, but nothing with an answer. 
  The problem can be resolved by removing VS2012 and .Net 4.5, but as we're intending to move to VS2013 company wide when it's released that's not really a solution.</p>
  
  <p>EDIT:
  Have got the error occuring in a sample app which does just this, and the exception is still thrown even if the application is built targetting 4.5</p>
  
  <p>Stack trace added in the comments below (It's null)</p>