title: System.ExecutionEngineException being thrown
body: <p>This exception is being thrown when this line of code gets executed</p>
  
  <pre><code>retobj = Marshal.PtrToStructure( buffer, anytype );
  </code></pre>
  
  <p>I don't know what is causing this because, the application I am attempting to run works fine on other developers machines here.  </p>
  
  <pre><code>public static object RawDeserialize(byte[] rawdatas, Type anytype) 
  {
      int rawsize = Marshal.SizeOf(anytype);
  
      if (rawsize > rawdatas.Length)
      {  
          return null;
      }
  
      IntPtr buffer = Marshal.AllocHGlobal(rawsize);
      object retobj = null;
  
      try 
      {
           Marshal.Copy(rawdatas, 0, buffer, rawsize);
           retobj = Marshal.PtrToStructure(buffer, anytype);
      }
      finally 
      {
           Marshal.FreeHGlobal(buffer);
      }
  
      return retobj;
  }
  </code></pre>
  
  <p>I've tried repairing the .NET Compact Framework multiple times and nothing seems to work, does anyone know of a solution to this?</p>