Heroicsoft.NetForge.Components 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Heroicsoft.NetForge.Components --version 1.0.0
                    
NuGet\Install-Package Heroicsoft.NetForge.Components -Version 1.0.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="Heroicsoft.NetForge.Components" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Heroicsoft.NetForge.Components" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Heroicsoft.NetForge.Components" />
                    
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 Heroicsoft.NetForge.Components --version 1.0.0
                    
#r "nuget: Heroicsoft.NetForge.Components, 1.0.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 Heroicsoft.NetForge.Components@1.0.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=Heroicsoft.NetForge.Components&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Heroicsoft.NetForge.Components&version=1.0.0
                    
Install as a Cake Tool

Heroicsoft.NetForge

Shared building blocks for the self-hosted MVC and Blazor apps. Authentication, result helpers, and the Hangfire dashboard filter are used by both. Heroicsoft.NetForge.Components is Blazor only: the shell, theme picker, toasts, and dialogs.

Packages

Package What it replaces
Heroicsoft.NetForge.Abstractions AuthProvider, IUserContextService, BootswatchThemes, AppVersion, DatabaseProviders, setup status, nav models
Heroicsoft.NetForge.Results ResultExtensions (To<T>, GetDisplayMessage)
Heroicsoft.NetForge.Authentication Identity / Keycloak / None registration, Keycloak back-channel and role mapping, /auth/login, setup redirect
Heroicsoft.NetForge.Components Shell, theme picker, toasts, confirm/prompt dialogs, pager, empty states, router
Heroicsoft.NetForge.Hangfire Administrator-only Hangfire dashboard filter

New app

<PackageReference Include="Heroicsoft.NetForge.Components" Version="1.0.0" />
<PackageReference Include="Heroicsoft.NetForge.Authentication" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.12" />

Restore Bootswatch, Bootstrap, and Bootstrap Icons into wwwroot/lib (see templates/libman.json). The theme picker swaps those stylesheets at runtime; the library does not embed them.

builder.Services.AddCascadingAuthenticationState();
builder.Services.AddNetForgeComponents(ui =>
{
    ui.ThemeStorageKey = "myapp.theme";
});
builder.Services.Configure<ForgeShellOptions>(shell =>
{
    shell.Brand = "My App";
    shell.SearchUrlFormat = "/?q={0}";
    shell.Sections.Add(new ForgeNavSection
    {
        Items =
        [
            new ForgeNavItem { Title = "Home", Href = "/", Icon = "bi-house", MatchAll = true },
        ],
    });
});

var auth = builder.Services.AddNetForgeAuthentication<ApplicationUser, ApplicationRole, ApplicationDbContext>(
    builder.Configuration);

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.UseNetForgeSetupGate(); // after registering ISetupStatus, if the app has a wizard
app.MapControllers();
if (auth == AuthProvider.Identity)
{
    app.MapRazorPages();
}

Components/App.razor:

<ForgeHostPage Title="My App" IconHref="img/Icon.png" AppStylesheet="@Assets["css/site.css"]">
    <ForgeRouter AppAssembly="typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)" />
</ForgeHostPage>

Authentication:Provider is Identity, Keycloak, or None, with the same Authentication:Keycloak keys the other apps already use. None signs every request in as a single administrator and must not be exposed beyond the machine running it.

Pages inject ToastService, DialogService, and SidebarRefresh instead of copying those types. ShellLayout is the default layout: set ForgeShellOptions.Sections for a static menu, or register IShellNavigation when the sidebar is loaded from data and call SidebarRefresh.NotifyChanged() after a write.

Hangfire hosts add Heroicsoft.NetForge.Hangfire and pass new AdministratorDashboardAuthorizationFilter() in the dashboard options.

MVC hosts keep their own /auth controller and IUserContextService. Pass IncludeAuthController = false, RegisterUserContext = false, and Identity.UseRelaxedPasswordPolicy = false. Keycloak behind a reverse proxy also sets RequireHttpsMetadata = false, correlation cookies to SameSite=None / Secure=Always, and RedirectBrowserToPublicAuthority = true. Set AccessDeniedPath to /Home/AccessDenied and RemoteFailurePath to /Home/Error. When Authentication:Keycloak:PublicOrigin is set, post-logout redirects to {PublicOrigin}/signout-callback-oidc.

Blazor hosts leave those flags at their defaults and pass the app's existing theme storage key (linkstash.theme, and the same pattern in the other apps) so a stored theme survives the switch to window.netForge.

Left in the app

Domain pages, EF contexts, and user-directory services stay in the app. IUserInfoService and the Keycloak admin client differ once they start returning each app's own user model, so they were not pulled into the library.

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 (3)

Showing the top 3 NuGet packages that depend on Heroicsoft.NetForge.Components:

Package Downloads
LogVue

An in-process Blazor dashboard for viewing, querying and deleting an ASP.NET Core application's logs.

Heroicsoft.NetForge.Components.Bootstrap

Bootstrap and Bootswatch implementation of the NetForge Blazor shell, theme picker, toasts, dialogs, paging, and status pages. For apps that already use Bootstrap; apps with their own styling use Heroicsoft.NetForge.Components.

IdentityNexus

A Blazor UI for administering ASP.NET Core Identity users and roles.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 93 10/27/2026
1.1.0 104 10/26/2026
1.0.3 135 10/23/2026
1.0.2 97 10/16/2026
1.0.1 100 10/16/2026
1.0.0 99 10/16/2026 1.0.0 is deprecated because it is no longer maintained.