none
Why Marshal's GetDelegateForFunctionPointer does not accept generic type delegates such as Func<int, int>? RRS feed

  • Question

  • It generates ArgumentException "The specified Type must not be a generic type definition.
    Parameter name: t"

    What is the reason for this to be?

    Saturday, November 7, 2009 9:23 AM

Answers

  • Hi,
    This restriction is caused by some technical difficulities, and the product team will do their best to improve it in future releases.
    Currently, as it is documented, we’d better avoid using generics in that method.

    Thanks,
    Eric
    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    • Marked as answer by eryang Wednesday, November 11, 2009 8:46 AM
    Wednesday, November 11, 2009 2:44 AM

All replies