Back to Devexpress

Create a Document Preview Application using the .NET CLI Project Template

xtrareports-405602-desktop-reporting-wpf-reporting-wpf-reporting-document-preview-quick-start-create-a-document-preview-app-with-cli.md

latest3.9 KB
Original Source

Create a Document Preview Application using the .NET CLI Project Template

  • Oct 13, 2025
  • 3 minutes to read

You can use the .NET command-line interface (CLI) to create an application with the WPF Document Preview control from the console. Note that the project template targets .NET 8.0+ and supports C# only.

Install DevExpress CLI Templates

Execute the following command to install DevExpress WPF project templates from nuget.org:

console
dotnet new install DevExpress.Wpf.ProjectTemplates

If the NuGet.org package source is disabled, you will get the following error: NU1101: Unable to find package DevExpress.WPF.ProjectTemplates. To see the list of sources and their status information, run the command dotnet nuget list source. To enable a source, run the command dotnet nuget enable source <source name>.

If you are new to NuGet, visit the following page for more information about package management prerequisites: An Introduction to NuGet.

Note

DevExpress CLI project templates are also available in the DevExpress NuGet Gallery (nuget.devexpress.com).

Create a Project

To create a WPF Document Viewer application, execute the following command:

console
dotnet new dx.wpf.reporting -n WPFDocumentPreview

The command creates a WPF application with Document Preview called WPFDocumentPreview in the current directory.

You can use the following parameters to see available command options: -? | -h | --help. For example, execute the following command:

console
dotnet new dx.wpf.reporting --help

Refer to the following documents for information on template options:

dotnet new command - OptionsStandard options for .NET CLI templates.Template OptionsOptions specific to the DevExpress WPF templates.

Build the Project

You need to configure your personal DevExpress NuGet Feed to load the required DevExpress component packages and build the resulting project. Follow the instructions below:

  1. Obtain your NuGet feed URL.
  2. Register the source. You can do this in your IDE or from a CLI:

Template Options

Template Options

The following list contains options you can specify when creating DevExpress WPF Reporting project templates:

-prerelease, --use-prerelease-dx-versionA flag that indicates whether to use a pre-release DevExpress package version in the project.--framework <TFM>Specifies the target framework. It expects a target framework moniker (TFM). Example: net8.0.--dx-version <version>Specifies DevExpress package version to be used in the project. Examples: 25.2.3, 25.2.*, 25.2.*-*``--dx-nuget-feed <feed>Specifies the NuGet Feed URL. Refer to nuget.devexpress.com to obtain your personal feed URL (available for registered users).-preload, --preload-resources

Preload theme resources on application launch to speed up the display time for all subsequent windows. For more information, refer to Preload Theme Resources.

Default: true

-lwthemes, --lightweight-themes

Use DevExpress lightweight themes instead of regular themes. For more information, refer to Lightweight Themes.

Default: true