Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steven Wilber 103 posts 98 karma points
    Jan 25, 2010 @ 02:32
    Steven Wilber
    2

    XSLT Extension - Cannot create an abstract class

    This is just for my benefit really so that next time I Google this problem there will be a solution out there, but maybe it helps somone else too.

    When creating my XSLT extension, which is a bunch of static methods in a class I kept getting the error below when using the "insert xslt:value-of" button.

    Cannot create an abstract class.

    Exception Details: System.MissingMethodException: Cannot create an abstract class.

    It turns out that this is because I made my class static - normally quite acceptable for a class of static methods, but removing the static keyword solves the problem.

    I hope that this helps someone else out there and saves an hour or two, or possibly just my future self (hi future self).

    Cheers

    Steve

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 25, 2010 @ 03:30
    Aaron Powell
    5

    You can't use static classes. You have to have a non-static class with a public default constructor to make an xslt extension.

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    May 11, 2011 @ 14:11
    Robert Foster
    0

    Oh good, spent a good bit of time tearing my hair out on this one... Worked like a charm when I removed the static modifier from the class.

Please Sign in or register to post replies

Write your reply to:

Draft