1

I am trying to get an EnvDTE.CodeTypeRef from a PropertyInfo.PropertyType.

I have tried the following

(EnvDTE.CodeTypeRef)(new CodeTypeReference(prop.PropertyType,CodeTypeReferenceOptions.GenericTypeParameter))

but get the following error message:

Running transformation: System.InvalidCastException: Unable to cast object of type 'System.CodeDom.CodeTypeReference' to type 'EnvDTE.CodeTypeRef'.

So, basically my question is how do I take a PropertyInfo.PropertyType and get an EnvDTE.CodeTypeRef from it?

4

0 回答 0