Table of Contents

Debugging and troubleshooting

When working with List & Label Cross Platform, effective debugging and troubleshooting can significantly streamline your development process. This page outlines common issues, error handling practices, and logging strategies to help you quickly identify and resolve problems.


Error handling

List & Label Cross Platform throws a ListLabelException whenever an error occurs during report generation. The exception includes a detailed message to help pinpoint the issue.

Example:

try
{
    listLabel.Export(exportConfiguration);
}
catch (ListLabelException ex)
{
    Console.WriteLine("An error occurred: " + ex.Message);
    // Additional error handling or logging
}

Logging

Logging is critical for troubleshooting. The ListLabel class supports logging via its Logger property, allowing you to use built-in solutions or integrate with popular frameworks.

Tip

Once the debugging tool Debwin4 is started in Cross Platform logging mode, every ListLabel instance is automatically configured with a dedicated logger. This logger uses the UDP protocol to transmit all logging output directly to Debwin4, ensuring that diagnostic and debug information is captured in real time without requiring any additional setup.

Using DebwinLogger

A basic file logging setup independent of Debwin4 and using DebwinLogger can be implemented as follows:

using DebwinLogger logger = new DebwinLogger("path/to/logfile.log", LogLevel.Info);
listLabel.Logger = logger;

Using Serilog for logging

Below is an example of how to configure Serilog as an ILogger implementation and bind it to the ListLabel component:

using Serilog;
using Microsoft.Extensions.Logging;

// Configure Serilog
Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Debug()
    .WriteTo.Console()
    .WriteTo.File("logs/listLabel.log", rollingInterval: RollingInterval.Day)
    .CreateLogger();

// Create a logger instance (using Microsoft.Extensions.Logging)
ILogger logger = LoggerFactory.Create(builder =>
{
    builder.AddSerilog();
}).CreateLogger<Program>();

// Assign the logger to ListLabel
listLabel.Logger = logger;
Tip
  • Set up logging early in your application to capture initialization issues.
  • Ensure that the log file path is accessible and has proper write permissions.
  • Use appropriate log levels (Debug, Info, Error) to filter messages based on your needs.

Common issues and resolutions

Missing dependencies

On Linux images, missing system libraries can cause errors. Ensure all required packages (e.g., libc6, libfontconfig1, libfreetype6, libpng16-16, libjpeg62-turbo, libgif7) are installed.

Incorrect file paths

Errors related to file access might indicate that the AutoProjectFile property is pointing to an incorrect or non-existent file. Verify that the file paths in your configuration are valid. In cloud based scenarios, consider using an IRepository implementation as storage medium.

Licensing problems

If your reports contain a trial watermark, confirm that your LicensingInfo is correct and that your edition type is Enterprise.


By following these guidelines and using the provided examples, you should be able to troubleshoot and resolve most issues encountered when working with List & Label Cross Platform. If you continue to experience problems, reach out to the Support Team or the community for further assistance.