This project is read-only.


Read PEFile with Exception when generic param constraint is a generic parameter


Write a simple class as following:
public class ClassA<T1, T2>
  private class ClassB<T3> where T3 : T2
Compile it with in a dll, and Read the dll by using PEFile.ReadPEFile, an exception will happened.
 Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'QUT.PERWAPI.GenericParam' to type 'QUT.PERWAPI.Class'.
Exception happend in MDElements.cs, see attached screenshot.

file attachments

Closed Aug 5, 2010 at 2:56 AM by k_john_gough
Release resolves this issue.


k_john_gough wrote Aug 3, 2010 at 3:57 AM

Hi All.
xie is right, the current version does not implement constraints correctly in this case.

I am doing a rewrite of that part of the code. It will go up later this week, after some more testing.

k_john_gough wrote Aug 4, 2010 at 12:25 PM

Hi All.
I have checked in the fixed sources in the source repository. I will upload the new distribution in the next few days. Otherwise you may build the DLL yourself from the source.

wrote Aug 5, 2010 at 2:56 AM

wrote Feb 13, 2013 at 2:06 AM

wrote May 15, 2013 at 3:59 AM