Is there any way the .NET 4.0 (or earlier) reflection API to resolve a generic type parameter? See the two lines after my ArgumentException comment for my current attempt.
[TestMethod]
public void TestGenericParameterTokenResolution()
{
Type genericParameter = typeof(List<>).GetGenericArguments()[0];
Assert.IsTrue(genericParameter.IsGenericParameter);
int metadataToken = genericParameter.MetadataToken;
// make sure the metadata token is a GenericParam
Assert.AreEqual(metadataToken & 0xFF000000, 0x2A000000);
Module module = typeof(List<>).Module;
// the following both throw an ArgumentException.
Type resolvedParameter = module.ResolveType(metadataToken);
resolvedParameter = (Type)module.ResolveMember(metadataToken);
Assert.AreSame(genericParameter, resolvedParameter);
}