AppoMobi.MauiRust.Templates 1.0.0-pre3

This is a prerelease version of AppoMobi.MauiRust.Templates.
dotnet new install AppoMobi.MauiRust.Templates@1.0.0-pre3
                    
This package contains a .NET Template Package you can call from the shell/command line.

AppoMobi.MauiRust.Templates

dotnet new templates for .NET MAUI apps with a Rust native library wired into MSBuild.
Press F5 — Rust builds automatically alongside C#, on Windows, Android, iOS, and MacCatalyst.


For users — install, create, update

Install

dotnet new install AppoMobi.MauiRust.Templates

Update to a newer template version

dotnet new update

This updates all installed template packages, including AppoMobi.MauiRust.Templates.
Existing projects are not affected — only new projects created after the update use the new template.

Uninstall

dotnet new uninstall AppoMobi.MauiRust.Templates

Create a new project

dotnet new maui-rust -n MyApp

This produces:

MyApp/
├── MyApp.sln
├── check-prerequisites.ps1     ← run on Windows to verify build prerequisites
├── check-prerequisites.sh      ← run on macOS/Linux to verify build prerequisites
├── Prerequisites.md            ← full setup guide
├── app/
│   └── MyApp/
│       └── MyApp.csproj        ← MAUI app, MSBuild wires Rust automatically
└── rust/
    └── myapp_native/           ← Rust crate (name derived from project name)
        ├── Cargo.toml
        └── src/lib.rs          ← your Rust FFI entry points

Open MyApp.sln in Visual Studio, select a target, press F5.
MSBuild runs cargo build before the MAUI build. No separate terminal needed.

Before building — verify prerequisites

Every generated project includes scripts that check what is missing:

# Windows
.\check-prerequisites.ps1
# macOS / Linux
chmod +x check-prerequisites.sh && ./check-prerequisites.sh

Each script reports what is installed and what is not, with the exact fix command for each missing item. See Prerequisites.md in the generated project for the full setup guide.


For developers — edit, test locally, publish

Repo layout

AppoMobi.MauiRust.Templates/
├── AppoMobi.MauiRust.Templates.csproj   ← NuGet packaging project
├── .github/workflows/
│   └── publish.yml             ← publishes on git tag push
└── content/
    └── MauiRust/               ← template source (sourceName = "MauiRust")
        ├── .template.config/
        │   └── template.json   ← template metadata
        ├── MauiRust.sln
        ├── app/MauiRust/       ← MAUI project
        └── rust/mauirustnativelib_native/  ← Rust crate (renamed on instantiation)

The sourceName = "MauiRust" setting in template.json replaces every occurrence of MauiRust — in file content, file names, and directory names — with the user-supplied project name. A separate casing generator replaces mauirustnativelib (the token embedded in crate and directory names) with the lowercased project name, so mauirustnativelib_native becomes e.g. myapp_native.

Edit the template

All template content lives under content/MauiRust/. Edit it like any normal project.

  • C# namespace and class names: use MauiRust — it will be replaced on instantiation.
  • Rust crate name: keep mauirustnativelib as the token inside crate/dir names — it is lowercased to the project name on instantiation (e.g. myapp_native).
  • MAUI project file: app/MauiRust/MauiRust.csproj.
  • Rust source: rust/mauirustnativelib_native/src/lib.rs.

Test locally without publishing

Step 1 — pack:

dotnet pack -c Release -o ./nupkg

Step 2 — install the local package:

dotnet new install ./nupkg/AppoMobi.MauiRust.Templates.1.0.0.nupkg

Step 3 — create a test project:

dotnet new maui-rust -n TestApp -o /tmp/TestApp

Inspect /tmp/TestApp to confirm the name substitution is correct.

Step 4 — uninstall when done:

dotnet new uninstall AppoMobi.MauiRust.Templates

Repeat from Step 1 after each edit. The version in the .nupkg filename comes from <PackageVersion> in AppoMobi.MauiRust.Templates.csproj — bump it to avoid NuGet's local cache serving an old package.

Bump the version

Edit AppoMobi.MauiRust.Templates.csproj:

<PackageVersion>1.1.0</PackageVersion>

Or override on the CLI without editing the file (useful for CI):

dotnet pack -c Release -p:PackageVersion=1.1.0 -o ./nupkg

Publish to NuGet.org and GitHub Packages

One-time setup — add the secret to GitHub:

Secret What it is Where to get it
NUGET_API_KEY NuGet.org API key scoped to push packages NuGet.org → Create → scope to AppoMobi.MauiRust.Templates, select Push new packages and package versions

GITHUB_TOKEN (used for GitHub Packages) is provided automatically — no secret to create.

Publish:

  1. Bump <PackageVersion> in AppoMobi.MauiRust.Templates.csproj and commit.
  2. Go to Actions → Publish NuGet → Run workflow.
  3. Choose whether to publish to NuGet.org, GitHub Packages, or both.
  4. Click Run workflow.

The workflow packs first, then publishes to the selected registries in parallel. The package is live on NuGet.org within a few minutes.

  • .NETStandard 2.0

    • No dependencies.

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
1.0.0-pre3 276 4/25/2026