Bielu.AspNetCore.LikeC4.Scalar 3.4.0

Prefix Reserved
dotnet add package Bielu.AspNetCore.LikeC4.Scalar --version 3.4.0
                    
NuGet\Install-Package Bielu.AspNetCore.LikeC4.Scalar -Version 3.4.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="Bielu.AspNetCore.LikeC4.Scalar" Version="3.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bielu.AspNetCore.LikeC4.Scalar" Version="3.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Bielu.AspNetCore.LikeC4.Scalar" />
                    
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 Bielu.AspNetCore.LikeC4.Scalar --version 3.4.0
                    
#r "nuget: Bielu.AspNetCore.LikeC4.Scalar, 3.4.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 Bielu.AspNetCore.LikeC4.Scalar@3.4.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=Bielu.AspNetCore.LikeC4.Scalar&version=3.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Bielu.AspNetCore.LikeC4.Scalar&version=3.4.0
                    
Install as a Cake Tool

Bielu.AspNetCore.LikeC4.Scalar

Draws the views of a LikeC4 architecture model in the Scalar API Reference in ASP.NET Core, next to the API documents they describe. Each view gets a sidebar entry and is drawn as LikeC4 laid it out, in Scalar's theme. Dynamic views can be drawn as sequence diagrams, and an element or step that opens another view links to it.

Installation

dotnet add package Bielu.AspNetCore.LikeC4.Scalar
dotnet add package Scalar.AspNetCore

Usage

Export the model, already laid out, to a file the app serves:

npx likec4 export json -o wwwroot/architecture.likec4.json architecture
app.MapStaticAssets();                                          // serves wwwroot/architecture.likec4.json
app.MapScalarLikeC4Assets();

app.MapScalarApiReference(options =>
{
    options.AddAsyncApiDocument("v1", "Events");                // the API documents the model describes
    options.AddLikeC4Document("architecture", "Architecture");  // /{documentName}.likec4.json by default
    options.WithLikeC4();
});

From a custom path

routePattern: sets the URL the model is fetched from; {documentName} in it is replaced with the model's name. Serve the file at that URL however you like, and give MapScalarLikeC4Assets and WithLikeC4 the same path to move the plugin bundle:

// architecture/architecture.json, in the project folder, served at /docs/architecture.json
app.UseStaticFiles(new StaticFileOptions
{
    FileProvider = new PhysicalFileProvider(Path.Combine(app.Environment.ContentRootPath, "architecture")),
    RequestPath = "/docs",
});
app.MapScalarLikeC4Assets("/assets/likec4");

app.MapScalarApiReference(options => options
    .AddLikeC4Document("architecture", "Architecture", routePattern: "/docs/{documentName}.json")
    .WithLikeC4("/assets/likec4"));

Requires Scalar.AspNetCore 3.0.1 or later, the first release bundling plugin document types (@scalar/api-reference 1.80.0, scalar/scalar#10816).

For the Scalar resource of a .NET Aspire AppHost, use Bielu.AspNetCore.LikeC4.Scalar.Aspire.

Documentation

Copyright (c) 2025 Arkadiusz Biel. Released under the MIT license.

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.  net11.0 is compatible. 
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
3.4.0 44 11/29/2026
3.4.0-beta.20261129131534 35 11/29/2026
3.4.0-beta.20261129131529 38 11/29/2026
3.4.0-beta.20261129131234 33 11/29/2026
3.4.0-beta.20261129125539 40 11/29/2026
3.4.0-beta.20261129105511 44 11/29/2026