Runic.Assets.AspNetCore
0.8.0-preview.3
dotnet add package Runic.Assets.AspNetCore --version 0.8.0-preview.3
NuGet\Install-Package Runic.Assets.AspNetCore -Version 0.8.0-preview.3
<PackageReference Include="Runic.Assets.AspNetCore" Version="0.8.0-preview.3" />
<PackageVersion Include="Runic.Assets.AspNetCore" Version="0.8.0-preview.3" />
<PackageReference Include="Runic.Assets.AspNetCore" />
paket add Runic.Assets.AspNetCore --version 0.8.0-preview.3
#r "nuget: Runic.Assets.AspNetCore, 0.8.0-preview.3"
#:package Runic.Assets.AspNetCore@0.8.0-preview.3
#addin nuget:?package=Runic.Assets.AspNetCore&version=0.8.0-preview.3&prerelease
#tool nuget:?package=Runic.Assets.AspNetCore&version=0.8.0-preview.3&prerelease
Runic.Assets.AspNetCore
Serve a Runic Assets manifest through ASP.NET Core GET and HEAD endpoints without recreating its media types, cache policy, content lengths, or entity tags.
Install
dotnet add package Runic.Assets.AspNetCore --prerelease
The package targets .NET 10, uses the shared Microsoft.AspNetCore.App
framework, and brings Runic.Assets with it. It is currently a preview package.
Choose this adapter for ASP.NET Core; choose the core package alone when you
only need an asset source or archive.
Map an embedded Vite build
After configuring RunicAssetsDist in the web application's project and
building the Vite dist directory, map the source in Program.cs:
using System.Reflection;
using Runic.Assets;
using Runic.Assets.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
AssetArchiveSource assets = AssetArchive.ReadEmbedded(
Assembly.GetExecutingAssembly());
app.MapRunicAssetSource(assets);
app.Run();
This serves the Vite entry point at / and /index.html, every manifest path
at its exact URL, and the entry point for missing paths without a file extension
(such as /settings/profile), so client-side routes survive a reload. A path
with a trailing slash, such as /settings/, is not an asset path and is not
served.
The endpoint matches only GET and HEAD requests for paths that resolve this
way. It runs after the application's own endpoints, including controller routes,
and before MapFallback. Other requests reach static files, a fallback or a
404.
With the fallback on, an unknown extensionless GET below the mount, such as
/api/typo, returns the entry point with status 200. If the same application
serves an API, mount the assets under a prefix or turn the fallback off. Add an
optional prefix when assets should live below a route:
app.MapRunicAssetSource(assets, "ui");
/ui and /ui/ both serve the entry point. Relative URLs in the document
resolve against / when it is requested as /ui, so build the frontend with an
absolute base, such as Vite's base: "/ui/".
The Desktop adapter in Runic.Assets.Desktop resolves paths with the same
AssetManifest.TryResolveRequestPath rules and defaults, so one archive routes
identically on both hosts. The hosts differ outside the adapters: Runic Desktop
answers other methods with 405 and decodes %2F in request paths, while
ASP.NET Core leaves both to the application. Pass AssetRoutingOptions to
change the rules:
// Only exact manifest paths; the root and unknown paths return 404.
app.MapRunicAssetSource(assets, routing: new AssetRoutingOptions
{
ServeEntryPointAtRoot = false,
EnableSinglePageApplicationFallback = false,
});
The adapter accepts an IAssetSnapshotSource, which opens each asset's
descriptor and stream together. AssetArchiveSource, EmbeddedAssetSource and
DevelopmentDirectoryAssetSource implement it.
HTTP behavior
Responses preserve the manifest-owned content type, length, cache-control
value, and strong ETag, and include X-Content-Type-Options: nosniff. text/*
content types without a charset are sent as UTF-8. HEAD returns the same
headers without a body.
Matching If-None-Match values receive 304 Not Modified. Unknown and invalid
paths that the routing options do not send to the entry point return 404; the
adapter never serves files outside the manifest.
Documentation and support
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Runic.Assets (= 0.8.0-preview.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0-preview.3 | 50 | 10/15/2026 |
| 0.8.0-preview.2 | 64 | 10/15/2026 |
| 0.8.0-preview.1 | 120 | 10/15/2026 |
| 0.7.0-preview.9 | 311 | 10/14/2026 |
| 0.7.0-preview.8 | 72 | 10/12/2026 |
| 0.7.0-preview.7 | 50 | 10/12/2026 |
| 0.7.0-preview.6 | 345 | 10/9/2026 |
| 0.7.0-preview.5 | 114 | 10/9/2026 |
| 0.7.0-preview.4 | 65 | 10/8/2026 |
| 0.7.0-preview.3 | 54 | 10/8/2026 |
| 0.7.0-preview.2 | 61 | 10/7/2026 |
| 0.7.0-preview.1 | 55 | 10/7/2026 |
| 0.6.0-preview.1 | 549 | 10/5/2026 |
| 0.5.0-preview.3 | 60 | 10/1/2026 |
| 0.5.0-preview.2 | 57 | 9/25/2026 |
| 0.4.0-preview.1 | 60 | 9/22/2026 |
| 0.3.0-preview.1 | 69 | 9/11/2026 |
| 0.2.0-preview.1 | 84 | 9/9/2026 |