Debugging XSL

One of the great advantages of being on the .NET platform is that the ePublisher platform now includes a debugger! Well, not really, but Microsoft does make one available for free in the form of Visual Studio 2017 Community Edition. Two downloads, one install, and just a wee bit of chicanery, you too can debug XSL like a Pro.

1. Download Visual Studio 2017 (Community Edition will work just fine).

2. Install Visual Studio with the .Net environment.

3. To enable XSL debugging in ePublisher, follow these steps:

  1. Shutdown ePublisher.
  2. Edit "WebWorks.ePublisherPro.exe.config" in your install directory with Notepad.

  3. Add the following entry if not present and set it to "true".
      <add key="DebugXSLTransforms"
           value="true" /> 
  4. Save your changes.

4. Download the C# solution (ePublisher XSL.VS2017.zip).

5. Unzip the C# solution to a convenient location.

6. Open up the resulting folder and double-click on "ePublisher XSL.sln".

7. Configure the following Debug Options:

8. Drag your favorite ePublisher XSL files into the Visual Studio window.

9. Within the C# interface, set breakpoints as necessary by choose Debug > Toggle Breakpoint (F9).

10. Hit F5 to start ePublisher and begin debugging.

11.Choose the project you want to debug.

12.Generate the project.


In the ePublisher C# folder, there lives in a file called ePublisher XSL.csproj.user. We've added an entry like so:

    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files (x86)\WebWorks\ePublisher\2018.1\ePublisher Designer\WebWorks.ePublisherDesigner.exe</StartProgram>

This appears within both the Debug and Release property groups:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files (x86)\WebWorks\ePublisher\2018.1\ePublisher Designer\WebWorks.ePublisherDesigner.exe</StartProgram>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files (x86)\WebWorks\ePublisher\2018.1\ePublisher Designer\WebWorks.ePublisherDesigner.exe</StartProgram>
  </PropertyGroup>
</Project>

Adjust the install path as necessary for your site.

DevCenter/Tips/DebuggingXSL (last edited 2018-08-24 20:59:38 by TonyMcDow)