Results 1 to 4 of 4

Thread: Debugging Extension Functions

  1. #1
    Join Date
    Aug 2008
    Posts
    20

    Default Debugging Extension Functions

    I am trying to debug one of the xml.config files in an editor. I am using the dump files from the images folder. Everything seems to be working fine until I hit:

    select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 0, $AltText)"

    At that point I get a debugging error that says:

    Error in XPath expression (unknown function - Name and number of arguments name and number of arguments do not match any function signature in the static content - 'urn:aspdnsf:LookupProductImage')

    I'm using xml spy and according to the documentation I need to:

    "If you want to use extension functions then you have to reference where they have been defined."

    Can anyone tell me how to reference the aspdnsf functions so I can debug properly?

  2. #2
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    You'll need to have the full source code version and you'll need to rebuild the AspDotNetStorefrontCore project to create the debugging symbols. Then, within Visual Studio you can open the XSLTExtensionFunctions class, set your breakpoints, and debug.

    In version 8.0.1.2, LookupProductImage has two signatures, one that takes 5 strings, and one that takes 6...but none that take an int:
    Code:
    LookupProductImage(string sProductID, String sImageFileNameOverride, String sSKU, String sDesiredSize, String sIncludeATag)
    and
    Code:
    LookupProductImage(string sProductID, String sImageFileNameOverride, String sSKU, String sDesiredSize, String sIncludeATag, String sAltText)
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    Join Date
    Aug 2008
    Posts
    20

    Default

    I have the source code and compiled it. I set the Xml.DumpTransform AppConfig to true.

    I tried to apply the transform xsl file from the images folder to the corresponding xml file from the images folder using XMLSpy from Altova. It was at that point that I got the error mentioned above. As far as I know XMLSpy will not let me put a breakpoint in the XSLTExtensionFunctions class.

    I also tried in VS 2008. I put the break point in the base class for the XSLTExtensionFunctions class. In this case when I tried to build the localhost the website did not launch and VS just waited. After I stopped the debugger the site loaded in the browser. The site will compile with no problem if I don't have any break points.

    Any ideas about what's going on?

  4. #4
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Use the Attach to Process feature in VS (the shortcut should be Ctrl +
    Alt + P or you can find it in the Debug menu) then just attach to the .NET worker process.

    Also, you won't be able to debug your live site unless A) you're using Visual Studio on the server where the site is installed, or B) your host has enabled remote debugging and you have everything configured to debug remote sites, or C) you have a copy of your live site restored on your local machine.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •