KitStack.AspNetCore 0.2.0

dotnet add package KitStack.AspNetCore --version 0.2.0
                    
NuGet\Install-Package KitStack.AspNetCore -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KitStack.AspNetCore" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KitStack.AspNetCore" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="KitStack.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KitStack.AspNetCore --version 0.2.0
                    
#r "nuget: KitStack.AspNetCore, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KitStack.AspNetCore@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KitStack.AspNetCore&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=KitStack.AspNetCore&version=0.2.0
                    
Install as a Cake Tool

KitStack.AspNetCore

ASP.NET Core integration for KitStack.Storage. Since 0.2 this package references no provider SDK; add the provider packages you use (KitStack.Storage.Local, .S3, .Azure, .Sftp, .Ftp) and register them on the builder returned by AddKitStackStorage (which now lives in KitStack.Abstractions).

Serving files

builder.Services.AddKitStackStorage(builder.Configuration).AddLocal();

app.UseAuthentication();
app.UseAuthorization();
app.MapKitStackStorageFiles("/files", o =>
    o.Authorize = (http, file) => ValueTask.FromResult(http.User.IsInRole("Archive")));
  • GET /files/{location} and, with an IFileEntryStore, GET /files/{id}.
  • Requires an authenticated user by default. Chain .RequireAuthorization("policy") or .AllowAnonymous().
  • Works for every provider, decrypts encrypted files, supports range requests and sends ETag/Last-Modified.
  • Images, audio, video, PDF and plain text are served inline. Everything else (HTML, SVG, scripts, ...) is sent as an attachment, with X-Content-Type-Options: nosniff and a sandboxing CSP.
  • With an IFileEntryStore registered, only recorded, non-deleted files are served.

Inside your own controllers:

await using var stream = await storage.OpenReadAsync(entry);
return File(stream, entry.ContentType);

Anonymous static files (0.1 behaviour, opt-in)

app.UseKitStackStorage(configuration) only serves the Local directory as anonymous static files when Storage:Local:ServeAnonymously is true.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0 0 10/29/2026
0.1.8 90 10/22/2026
0.1.6 175 3/25/2026
0.1.5 144 1/14/2026
0.1.4 136 1/13/2026
0.1.3 146 1/13/2026
0.1.2 140 1/13/2026
0.1.1 140 1/13/2026
0.1.0 140 1/13/2026