This topic explains how to build and publish the HiQPdf Next ASP.NET demo applications which can be downloaded as a ZIP file from the HiQPdf website. It should be used after completing the Getting Started guide for Windows and the corresponding Getting Started guide for Linux. The topic includes instructions for the Windows demo, the Linux demo and the Cross-Platform demo.
The Windows demo is located in the Windows folder and uses the HiQPdf.Next.Windows metapackage from NuGet, which contains .NET Standard 2.0 assemblies and the Windows runtimes for all HiQPdf Next components.
The demo application can be deployed to Windows servers, Azure App Service Windows, Azure Functions Windows or Docker Windows containers.
The Windows demo project file is HiQPdf_Next_AspNetDemo_Windows.csproj and there are separate versions for .NET 8 and .NET 10. The target framework can be changed in the project file as described below.
As an example, the project that targets .NET 8.0 can be upgraded to target .NET 10.0 by simply changing the TargetFramework element in the .csproj project file from net8.0 to net10.0.
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>To build the Windows demo application, run:
dotnet build -c Release -r win-x64 HiQPdf_Next_AspNetDemo_Windows.csprojThe build output will be placed in bin\Release\net8.0 (or net10.0). To get a runnable folder including all assets, you must publish the application.
To publish the Windows demo application, run:
dotnet publish -c Release -r win-x64 -o publish/windows HiQPdf_Next_AspNetDemo_Windows.csprojThe published application files will be available in the publish/windows folder.
You can add the self-contained option (-r win-x64 --self-contained true) to the publish command to create a self-contained deployment that does not require the .NET runtime to be installed on the target machine.
To run the published Windows demo application from the command line, execute the following command:
dotnet publish/windows/HiQPdf_Next_AspNetDemo_Windows.dllThe application will start and listen on the configured port (for example http://localhost:5000) and you can access it from a web browser running on the same machine or remotely if the network is properly configured.
On Windows, no additional configuration is normally required. For platform-specific deployment details, consult the Getting Started on Windows guide as well as the specific guides for Publishing to Azure App Service Windows, Publishing to Azure Functions Windows or Publishing to Docker on Windows.
The Linux demo is located in the Linux folder and uses the HiQPdf.Next.Linux metapackage from NuGet, which contains .NET Standard 2.0 assemblies and the Linux runtimes for all HiQPdf Next components.
The demo application can be deployed to Linux servers, Azure App Service Linux, Azure Functions Linux or Docker Linux containers.
The Linux demo project file is HiQPdf_Next_AspNetDemo_Linux.csproj and there are separate versions for .NET 8 and .NET 10. The target framework can be changed in the project file as described below.
As an example, the project that targets .NET 8.0 can be upgraded to target .NET 10.0 by simply changing the TargetFramework element in the .csproj project file from net8.0 to net10.0.
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>To build the Linux demo application, run:
dotnet build -c Release -r linux-x64 HiQPdf_Next_AspNetDemo_Linux.csprojThe build output will be placed in bin\Release\net8.0 (or net10.0). To get a runnable folder including all assets, you must publish the application.
To publish the Linux demo application, run:
dotnet publish -c Release -r linux-x64 -o publish/linux HiQPdf_Next_AspNetDemo_Linux.csprojThe published application files will be available in the publish/linux folder.
You can add the self-contained option (-r linux-x64 --self-contained true) to the publish command to create a self-contained deployment that does not require the .NET runtime to be installed on the target machine.
To run the published Linux demo application from the command line, execute the following command:
dotnet publish/linux/HiQPdf_Next_AspNetDemo_Linux.dllThe application will start and listen on the configured port (for example http://localhost:5000) and you can access it from a web browser running on the same machine or remotely if the network is properly configured.
On Linux, additional packages must be installed before running HTML to PDF conversion. For platform-specific deployment details and the list of required system dependencies, consult the Getting Started on Linux guide as well as the specific guides for Publishing to Azure App Service Linux, Publishing to Azure Functions Linux or Publishing to Docker on Linux.
The Cross-Platform demo is located in the AllPlatforms folder and uses the HiQPdf.Next metapackage from NuGet, which contains .NET Standard 2.0 assemblies and the runtimes for all HiQPdf Next components for both Windows and Linux platforms.
The HiQPdf.Next package automatically includes:
HiQPdf.Next.Windows NuGet package
HiQPdf.Next.Linux NuGet package
This package is ideal when developing on one OS and deploying on multiple runtime environments. The demo application can be deployed to Windows and Linux servers, Azure App Service, Azure Functions or Docker containers for both Windows and Linux.
The cross-platform project file is HiQPdf_Next_AspNetDemo_All_Platforms.csproj and there are separate versions for .NET 8 and .NET 10. The target framework can be changed in the project file as described below.
As an example, the project that targets .NET 8.0 can be upgraded to target .NET 10.0 by simply changing the TargetFramework element in the .csproj project file from net8.0 to net10.0.
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>To build the portableversion:
dotnet build -c Release HiQPdf_Next_AspNetDemo_All_Platforms.csprojPublish the portable version:
dotnet publish -c Release -o publish/portable HiQPdf_Next_AspNetDemo_All_Platforms.csprojThe portable build can run on any supported platform where the .NET runtime is installed.
Publish for Windows:
dotnet publish -c Release -r win-x64 -o publish/windows HiQPdf_Next_AspNetDemo_All_Platforms.csprojPublish for Linux:
dotnet publish -c Release -r linux-x64 -o publish/linux HiQPdf_Next_AspNetDemo_All_Platforms.csprojYou can add the self-contained option (--self-contained true) together with the runtime identifier (for example -r win-x64 for Windows or -r linux-x64 for Linux) to the publish command to create a self-contained deployment that does not require the .NET runtime to be installed on the target machine.
Building for all platforms supported by the HiQPdf.Next metapackage may bring many files in the output folder. During development it is often useful to restrict build output to a single OS.
To limit the build and publish to a specific platform, set the RuntimeIdentifier property in the project file.
To limit to Windows x64:
<PropertyGroup>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>To limit to Linux x64:
<PropertyGroup>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>The HiQPdf Next libraries automatically detect the operating system at runtime and use the appropriate files for the platform.
On Windows, no additional configuration is normally required. For platform-specific deployment details, consult the Getting Started on Windows guide as well as the specific guides for Publishing to Azure App Service Windows, Publishing to Azure Functions Windows or Publishing to Docker on Windows.
On Linux, additional packages must be installed before running HTML to PDF conversion. For platform-specific deployment details and the list of required system dependencies, consult the Getting Started on Linux guide as well as the specific guides for Publishing to Azure App Service Linux, Publishing to Azure Functions Linux or Publishing to Docker on Linux.
Run the portable build which will automatically select the runtime based on the host platform:
dotnet publish/portable/HiQPdf_Next_AspNetDemo_All_Platforms.dllRun after Windows publish:
dotnet publish/windows/HiQPdf_Next_AspNetDemo_All_Platforms.dllRun after Linux publish:
dotnet publish/linux/HiQPdf_Next_AspNetDemo_All_Platforms.dllYou can now continue with the platform-specific deployment guides such as Publishing to Azure App Service Windows or Publishing to Azure App Service Linux for Azure App Service, Publishing to Azure Functions Windows or Publishing to Azure Functions Linux for Azure Functions, Publishing to Docker on Windows or Publishing to Docker on Linux for Docker.