UA.Tenet.Web 10.0.3

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

UA.Tenet.Web

NuGet Downloads

UA.Tenet.Web is the ASP.NET Core host layer for Tenet. It keeps web startup opinionated but still overridable: service registration, middleware composition, minimal API discovery, MVC helpers, request extensions, and UI helpers all stay aligned around the same conventions.

Why this package exists

Use UA.Tenet.Web when the host needs:

  • one convention-based entry point for API or MVC startup
  • shared JSON, compression, localization, session, HSTS, and OpenAPI defaults
  • automatic minimal API discovery from feature classes marked with [TenetMinimal]
  • reusable MVC, Razor, and image helper behavior on top of the Tenet core package

Best fit

Use UA.Tenet.Web when you are building:

  • an API host that wants Tenet defaults for OpenAPI, JSON, compression, localization, and endpoint discovery
  • an MVC application that wants those API defaults plus controllers with views and Razor conventions
  • a mixed host that serves controllers and minimal endpoints from the same application
  • a host that wants the Tenet web boundary without moving domain and application logic out of UA.Tenet

Package characteristics

  • Targets .NET 8, .NET 9, and .NET 10.
  • Builds on UA.Tenet rather than replacing it.
  • Integrates Swagger and OpenAPI through Swashbuckle.AspNetCore.
  • Ships XML documentation, SourceLink metadata, package symbols, and a package README.

Entry point map

Entry point Use it for Current behavior
AddTenetApi() API host service registration Adds authorization, authentication, CORS, HttpClient, logging, API explorer, caches, response caching, session, localization, HSTS, Tenet JSON defaults, response compression, and Swagger generation
AddTenetMvc() MVC and Razor host service registration Builds on AddTenetApi(), then adds controllers with views, view localization, and Tenet Razor view-location conventions
UseTenet() Runtime pipeline composition Applies Swagger when enabled, proxy forwarding, HSTS, HTTPS redirection, localization, compression, static files, cookie policy, routing, CORS, session, authentication, authorization, and endpoint mapping
MapTenetMinimals() Minimal API discovery Scans loaded assemblies for [TenetMinimal], maps methods from ASP.NET Core HTTP attributes, defaults to GET, and groups endpoints by declaring type
TenetWebOptions Pipeline overrides Controls OpenAPI exposure, CORS, localization, static files, proxy forwarding, authentication, HTTPS redirection, and endpoint mapping

Reusable web helpers

Beyond startup, the package includes helpers that keep common web behavior consistent:

  • ViewController for title, description, and localizer-backed MVC controllers
  • ViewComponentBase for convention-based component view naming
  • ActionExecutingContextExtension and RazorPageBaseExtension for action and view convenience helpers
  • HttpRequestExtension for CSV and XML content-type checks
  • TenetImageTagHelper for local SVG inlining and improved default image markup

Installation

dotnet add package UA.Tenet.Web

Quick start

API-first host

using Microsoft.OpenApi.Models;
using UA.Tenet.Web.Extensions;
using UA.Tenet.Web.Minimals;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddTenetApi(options =>
{
    options.SwaggerDoc("v1", new OpenApiInfo
    {
        Title = "Orders API",
        Version = "v1"
    });
});

var app = builder.Build();

app.UseTenet(options =>
{
    options.EndpointRouteBuilder = endpoints =>
        endpoints.MapTenetMinimals(builder => builder.RequireAuthorization());
});

app.Run();

MVC host with controllers and minimals

using UA.Tenet.Agents.Extensions;
using UA.Tenet.Services.Extensions;
using UA.Tenet.Web.Extensions;
using UA.Tenet.Web.Minimals;

var builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddTenetServices()
    .AddTenetAgents()
    .AddTenetMvc();

var app = builder.Build();

app.UseTenet(options =>
{
    options.EndpointRouteBuilder = endpoints =>
    {
        endpoints.MapTenetMinimals();
        endpoints.MapControllers();
    };
});

app.Run();

Add a minimal endpoint container

using Microsoft.AspNetCore.Mvc;
using UA.Tenet.Web.Minimals;

[TenetMinimal]
public static class DiagnosticsMinimal
{
    [HttpGet("/api/health")]
    public static IResult Get()
    {
        return Results.Ok(new { status = "ok" });
    }
}

Use tag helpers where Tenet adds behavior

@addTagHelper *, UA.Tenet.Web

<img src="~/images/logo.svg" />
<img src="~/images/product.jpg" asp-append-version="true" alt="Product cover" />

Tune the pipeline

app.UseTenet(options =>
{
    options.IsOpenApiEnabled = app.Environment.IsDevelopment();
    options.CorsPolicyName = "Frontend";
    options.RequestLocalizationOptions = localization =>
    {
        localization.SetDefaultCulture("en");
        localization.AddSupportedCultures("en", "es");
        localization.AddSupportedUICultures("en", "es");
    };
    options.EndpointRouteBuilder = endpoints => endpoints.MapTenetMinimals();
});

Important runtime behavior

  • AddTenetApi() configures both MVC JSON options and HTTP JSON options through Json.SetTenetDefault().
  • IsOpenApiEnabled defaults to true only when ASPNETCORE_ENVIRONMENT equals Development.
  • UseTenet() always applies HSTS, and both UseHttpsRedirection and UseAuthentication default to true.
  • If CorsPolicyName is not set, the fallback CORS path is intentionally permissive. Prefer a named policy in production.
  • AddTenetMvc() clears the default view locations and registers /{0}.cshtml, /Views/{1}/{0}.cshtml, and /Views/{0}.cshtml.
  • MapTenetMinimals() scans assemblies already loaded into the current AppDomain. Endpoint tags come from the declaring type name, and a trailing Minimal suffix is removed.
  • TenetImageTagHelper inlines local .svg files from wwwroot. Other images remain img tags and gain lazy loading, async decoding, and inferred alt text when those attributes are missing.

Relationship to UA.Tenet

UA.Tenet.Web is the web layer built on top of UA.Tenet. Keep business and integration logic in the core package, then compose the ASP.NET Core host with UA.Tenet.Web.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
10.0.3 543 4/1/2026
10.0.2 117 4/1/2026
10.0.1 110 3/31/2026
10.0.0 100 3/26/2026
4.11.3 166 3/25/2026
Loading failed

See https://docs.uadevs.org/tenet/web/release-notes for release notes and documentation.