QuestPDF/QuestPDF · warning · NotSupportedException
The Previewer application is no longer supprted. Please use
Error message
The Previewer application is no longer supprted. Please use a new QuestPDF Companion application by calling ShowInCompanion() or ShowInCompanionAsync() methods.
What it means
The legacy ShowInPreviewer synchronous extension is marked [Obsolete] and unconditionally throws NotSupportedException with the deprecation message. The old Previewer app was replaced by the QuestPDF Companion; this stub exists only to surface a clear migration error at runtime.
Source
Thrown at src/dotnet/library/QuestPDF/Companion/Previewer.cs:20
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using QuestPDF.Companion;
using QuestPDF.Drawing;
using QuestPDF.Infrastructure;
namespace QuestPDF.Previewer;
public static class PreviewerExtensions
{
private const string ObsoleteMessage = "The Previewer application is no longer supprted. Please use a new QuestPDF Companion application by calling ShowInCompanion() or ShowInCompanionAsync() methods.";
[Obsolete(ObsoleteMessage)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
public static void ShowInPreviewer(this IDocument document, int port = 12500)
{
throw new NotSupportedException(ObsoleteMessage);
}
[Obsolete(ObsoleteMessage)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
public static Task ShowInPreviewerAsync(this IDocument document, int port = 12500, CancellationToken cancellationToken = default)
{
throw new NotSupportedException(ObsoleteMessage);
}
}View on GitHub (pinned to 43ab125596)
Solutions
- Replace ShowInPreviewer() with ShowInCompanion() (or the async variant) and run on .NET 8+.
- Remove all references to the QuestPDF.Previewer namespace / ShowInPreviewer usings.
- Update docs/tutorials to the Companion API.
Example fix
// before: doc.ShowInPreviewer(); // after: doc.ShowInCompanion();
Defensive patterns
Strategy: validation
Validate before calling
// Simply do not call ShowInPreviewer; use the Companion API. document.ShowInCompanion();
Prevention
- Remove all ShowInPreviewer usings/calls.
- Use ShowInCompanion on .NET 8+.
When it happens
Trigger: Calling document.ShowInPreviewer() on any current QuestPDF version. The method body only throws - it performs no work.
Common situations: Carrying forward code from an older QuestPDF version that used the Previewer; following an outdated tutorial/sample that calls ShowInPreviewer.
Related errors
- The hot-reload feature requires .NET 8 or later.
- Cannot connect to the QuestPDF Companion tool. Please ensure
- The QuestPDF Companion application is not compatible. Please
- The QuestPDF Companion App does not currently support merged
AI-assisted analysis of QuestPDF/QuestPDF@43ab125596 (2026-08-13).
Data as JSON: /api/errors/d38b7fe3cece2c9e.
Report an issue: GitHub.