Skip to main content
net10.0

Ships the Pagefind browser query runtime (pagefind.js + wasm) as embedded resources with an MSBuild task that extracts them on build.

Published
Nov 11, 2026
11d ago
Total Downloads
26.0K
25,955

Install

dotnet add package Pagefind.Net.Frontend --version 0.5.0
ProductVersions
.NET
net10.0

README

Pagefind.Net.Frontend

Ships the Pagefind browser query runtime (pagefind.js and wasm.en.pagefind) as embedded resources. An MSBuild target automatically extracts the files into your project on build -- no npm install required.

Ships Pagefind 1.5.2 runtime.

Automatic extraction

Install the package and the frontend files appear in wwwroot/pagefind/ after every build:

dotnet add package Pagefind.Net.Frontend

The output path is configurable in your .csproj:

<PropertyGroup>
  <PagefindFrontendOutputPath>wwwroot/pagefind</PagefindFrontendOutputPath>
</PropertyGroup>

To disable automatic extraction entirely:

<PropertyGroup>
  <PagefindFrontendDisableExtract>true</PagefindFrontendDisableExtract>
</PropertyGroup>

Programmatic API

Extract the runtime files from code using PagefindFrontend.ExtractToAsync:

using Pagefind.Net.Frontend;

string[] written = await PagefindFrontend.ExtractToAsync("wwwroot/pagefind");

The method writes files only when the embedded version is newer than what is already on disk (tracked via a version marker file). Pass force: true to always overwrite.

An overload accepting IFileSystem is available for testing.

ASP.NET integration

ASP.NET does not recognize Pagefind's custom file extensions by default. Register them in your static file middleware:

using Microsoft.AspNetCore.StaticFiles;

var contentTypeProvider = new FileExtensionContentTypeProvider();
contentTypeProvider.Mappings[".pf_meta"] = "application/octet-stream";
contentTypeProvider.Mappings[".pf_index"] = "application/octet-stream";
contentTypeProvider.Mappings[".pf_fragment"] = "application/octet-stream";
contentTypeProvider.Mappings[".pagefind"] = "application/wasm";

app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider });

Without these mappings, the Pagefind JS runtime will receive 404 responses when loading index data.

Documentation

Full documentation: nullean.github.io/pagefind-net

Changes from Previous Version

No structural changes between v0.4.2 and v0.5.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.