Copied to clipboard

Flag this post as spam?

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


  • Mikael Mørup 297 posts 326 karma points
    May 11, 2009 @ 12:55
    Mikael Mørup
    0

    XSLT extension problem

    I'm trying to create my first "hello world" XSLT extension. I have some problems.

    I created the extension usning vb.net 2008 as simple as possible like this:

    Namespace xlstTest
    Public Class helloWorldExt
    Public Shared Function sayHello() As String
    Return "Hello world"
    End Function
    End Class
    End Namespace

    I copied the dll to the bin foldere and added this :



    to the xsltExtension.config file.

    When i try to use the extension in an XSLT file i get this YSOD:

    Could not load type xlstTest.helloWorldExt (C:\inetpub\wwwroot\bin\HelloWorldExt.dll) for XSLT extension C:\inetpub\wwwroot\bin\HelloWorldExt.dll. Please check config/xsltExentions.config.

    I really tried to check everything according to the umbracoTV video, and i can't see what i'm doing wrong. Can anybody spot my mistake ?

    Thanks

    Mikael

  • Richard Soeteman 3875 posts 12037 karma points MVP
    May 11, 2009 @ 13:17
    Richard Soeteman
    0

    Hi Mikael,

    Did you name your Assembly HelloWorldExt (= the same as projectname)?

    Cheers,

    Richard

  • Mikael Mørup 297 posts 326 karma points
    May 11, 2009 @ 13:32
    Mikael Mørup
    0

    Yes the name of both my project and the DLL file is HelloWorldExt.

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 11, 2009 @ 13:43
    Ismail Mayat
    0

    Your method needs to be static thats the way when umbraco loads using reflection it picks up xslt extension methods.

    Regards

    Ismail

  • Jesper Ordrup 1000 posts 1478 karma points MVP
    May 11, 2009 @ 13:55
    Jesper Ordrup
    0

    My guess is it's some sort of security issue. Did you move the file to bin folder?

    Try copying it instead. This will make Windows adapt the folder security

    /Jesper

  • Mikael Mørup 297 posts 326 karma points
    May 11, 2009 @ 14:01
    Mikael Mørup
    0


    Ismail:

    shared in VB.net = static in C#

    Jesper:

    i did copy the dll file, but i will double check the security settings

    Tanks both

    Mikael

  • Mikael Mørup 297 posts 326 karma points
    May 11, 2009 @ 14:10
    Mikael Mørup
    0

    It doesent seem to be a access rigths problem, i just tried to give "everyone full control" to the file, and i still get the same YSOD.

    I hope i'm right about public static in c# being public shared in VB.net, but i'm rather sure about that.

    mikael

  • Peter Dijksterhuis 1442 posts 1722 karma points
    May 11, 2009 @ 14:45
    Peter Dijksterhuis
    0

    Hm, did you make a typo? xlstTest instead of xsltTest?

  • Mikael Mørup 297 posts 326 karma points
    May 12, 2009 @ 08:43
    Mikael Mørup
    0

    I double and triple checked everything for typos, and i'm quit sure that is not the problem either.

    Mikael

  • Mikael Mørup 297 posts 326 karma points
    May 12, 2009 @ 10:10
    Mikael Mørup
    0

    SOLVED.

    My geek college fond the problem, it was a double namespace.

    In VB there is an implicit namespace and i added one one too.

    So i had namespace.namespace.classname.

    As soon as i deleted the namespace i put around my class, everything worked as expected.

    Thanks for all your suggestions

    Mikael

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies