AventusSharp.Maui 0.0.21

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

AventusSharp

AventusSharp provides data modeling, business logic, routing and frontend generation for ASP.NET Core and .NET MAUI applications. The packages are split so an application only references its host integration and the database providers it uses.

Installation

Choose one host integration:

dotnet add package AventusSharp.AspNetCore
# or
dotnet add package AventusSharp.Maui

Then add one or more database providers:

dotnet add package AventusSharp.Data.Sqlite
dotnet add package AventusSharp.Data.Mysql
dotnet add package AventusSharp.Data.Postgresql
dotnet add package AventusSharp.Data.Mssql

AventusSharp.Core is brought transitively by the host and provider packages. It can also be referenced directly for host-independent code.

Each project contains an aventus.sharp.avt configuration. The generated Aventus files are centralized under AventusJs/src/generated.

.NET MAUI startup

Register the bridge before building the application, then initialize the data managers and portable router:

var builder = MauiApp.CreateBuilder();
builder
    .UseMauiApp<App>()
    .AddAventus();

var app = builder.Build();
app.UseAventusData();
app.UseAventusHttp();

return app;

AventusMauiBridge can then be resolved from app.Services and used by a WebView bridge to execute Aventus routes in-process.

Translations

Library errors and validation messages include English (default) and French translations. Applications can use the same system for their own messages, without depending on ASP.NET Core.

ASP.NET Core

Call this before the HTTP, WebSocket and SSE middleware:

using AventusSharp;
using AventusSharp.Localization;

app.UseAventusTranslations(options =>
{
    options.DefaultCulture = "fr";
    options.Add("fr", AventusMessageKeys.Validation.Unique, "Cette valeur est déjà utilisée.");
    options.Add("fr", "App.Welcome", "Bonjour {0} !");
    options.Add("en", "App.Welcome", "Hello {0}!");
});
app.UseAventusHttp();

The middleware uses ASP.NET Core request localization (query string, culture cookie, then Accept-Language) with English and French enabled by default. options.Add also registers its language; use options.SupportedCultures.Add("de") when translations come from a provider or resources. The default language handles unsupported requests. Each application's configuration and each request's language are isolated. If request localization is already configured, place it first and pass useRequestLocalization: false. The optional configureRequests callback lets you customize ASP.NET Core's language selection.

MAUI, console and workers

For MAUI, call app.UseAventusTranslations(options => options.DefaultCulture = "fr") after building the application and before initializing Aventus features. For other hosts, configure once at startup:

AventusTranslations.Configure(options =>
{
    options.DefaultCulture = "fr";
    options.Add("fr", "App.Welcome", "Bonjour {0} !");
    options.Add("en", "App.Welcome", "Hello {0}!");
});

string welcome = AventusTranslations.Get("App.Welcome", "Alice");
using (AventusTranslations.UseCulture("en"))
{
    string english = AventusTranslations.Get("App.Welcome", "Alice");
}

Culture scopes follow asynchronous execution and restore the previous language when disposed. Outside a scope, the configured default language is used. They do not change the process's .NET culture. ASP.NET Core configuration applies to requests; use Configure separately for startup work or background jobs, or create an independent AventusLocalizer and use AventusTranslations.Use(localizer, culture) for a job.

Application resources and custom providers

Library keys are generated from Messages.resx at build time and exposed as constants, for example AventusMessageKeys.Validation.Unique or AventusMessageKeys.Data.ManagerNotFound. They provide completion and compile-time checking of key names while remaining compatible with string-based providers and configuration. Do not edit the generated files under obj.

To generate the same constants for your application, add this to its .csproj (the generation target is included transitively in the AventusSharp.Core NuGet package):

<ItemGroup>
  <AventusMessageCatalog Include="Resources/Messages.resx"
                         Namespace="MyApplication"
                         ClassName="AppMessageKeys" />
</ItemGroup>

Use the neutral catalog only. Keys must be unique, dot-separated C# identifiers: App.Welcome becomes AppMessageKeys.App.Welcome. A key cannot also name a group, and members cannot have the same name as their containing class. Invalid keys fail the build with a diagnostic. Generation works with dotnet build on all supported .NET SDK platforms, without PowerShell or an additional executable.

options.Add("fr", AppMessageKeys.App.Welcome, "Bonjour {0} !");
string welcome = AventusTranslations.Get(AppMessageKeys.App.Welcome, "Alice");

Generating keys does not register translations: use Add or AddResources below. With a source ProjectReference instead of NuGet, explicitly import AventusSharp.Core/buildTransitive/AventusSharp.Core.targets from your checkout.

For larger catalogs, register your application's .resx resource manager:

options.AddResources(new System.Resources.ResourceManager(
    "MyApplication.Resources.Messages", typeof(Program).Assembly));

Alternatively assign options.Provider to an IAventusMessageProvider implementation. Its GetTemplate(string key, CultureInfo culture) returns a template or null to continue the fallback search. Providers may read JSON, a database, or other resources; they must support concurrent reads. Settings are copied when configuration completes.

For each culture, lookup checks Add overrides, the provider, then registered resource managers. It searches the requested culture and parents, then the configured default and parents, then English, before the built-in catalog. Thus application overrides also take precedence over library translations in other languages. Unknown keys are returned unchanged. Templates use .NET composite formatting ({0}, {1:N2}, {{ for a literal brace); invalid templates or mismatched arguments raise FormatException.

Built-in keys and their argument positions are listed in Messages.resx, with French in Messages.fr.resx. .NET builds the French satellite assembly automatically and includes it with the package.

Messages are resolved when the error or validation result is created. Error codes, JSON fields and explicitly supplied custom messages are preserved. Exceptions from .NET/database drivers and technical logging are not automatically translated.

Documentation

The documentation is available here https://sharp.aventusjs.com.

Run the complete local test suite with:

dotnet test AventusSharpTest/AventusSharpTest.csproj

Publication

All NuGet packages share the same version and are built before publication:

npm run release -- 1.2.3

The script updates every package project, builds the complete solution, creates the packages under artifacts/packages, then calls the custom dotnet-publish command for each package. To validate locally without publishing:

npm run release -- 1.2.3 --skip-publish
npm run release -- 1.2.3 --dry-run

Contributor

Your support plays a vital role in our ability to enhance Aventus, expand its capabilities, and empower developers like you to create exceptional web experiences. Together, we can invest more time and resources into making Aventus even more powerful and providing new opportunities for programming professionals.

You can also give us financial support via github donations.

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.0.21 52 9/9/2026
0.0.20 91 9/5/2026
0.0.19 78 8/31/2026
0.0.18 104 8/12/2026
0.0.17 99 8/8/2026
0.0.16 95 8/5/2026
0.0.15 98 8/5/2026