Build with .NET
Start with the UI framework in your executable app. Each guide takes you from installing the right package to starting one AppPortal client. Your shared C# code uses the same telemetry API.
Install from NuGet
The public 3.0.384 release is available on NuGet.org for plain .NET, MAUI, and Uno. Use the matching adapter and runtime versions. If AppPortal supplied a different release, use the package source and version from that release.
What are you building?
- .NET MAUI — initialize in native startup before MAUI, register the existing client in DI, track visible pages automatically, and opt into Shell navigation timing.
- Uno Platform - initialize supported Skia heads on Android, Apple and Desktop, then observe Frame navigation; check the guide’s native WinUI and BrowserWasm limitations.
- Native Android or iOS UI in C# - initialize before the Android Application base constructor or iOS application startup.
For a WPF, Windows Forms, or other managed .NET app, use AppPortal.Telemetry at the application
composition root. The shared .NET guide covers that setup.
Check target coverage for your host. The typed Avalonia integration is described
below; generic managed setup alone does not attach its lifecycle or navigation hooks.
Prism is optional. Native, MAUI, Uno, desktop, and headless code can use the SDK directly or inject
IAppPortalClient. In a Prism application, initialize the SDK first, then add the logging or Region
adapter for the APIs that application already uses. A background entry point that has no Prism
container can call the already-initialized SDK directly.
Avalonia
The current SDK source provides AppPortal.Telemetry.Avalonia over the same Telemetry runtime.
Choose it only with an exact compatible package supplied by your release channel; this source
example does not establish package publication or execution on every Avalonia target. The integration
supports the Avalonia 11.3 API floor; the integration app is a separate compatibility check.
dotnet add package AppPortal.Telemetry.Avalonia --version "3.0.401"
In the existing desktop Program class, replace its BuildAvaloniaApp method so telemetry starts
before constructing the Avalonia Application, then attach framework observation to that same runtime:
using AppPortal;
using Avalonia;
public static AppBuilder BuildAvaloniaApp()
{
var createApp = AppPortalSdk.CreateBuilder("<app-credential>")
.Start(() => new App());
return AppBuilder.Configure(createApp).UsePlatformDetect().UseAppPortal();
}
Keep the existing desktop lifetime call and app class. Consent remains pending until your application’s
normal consent action, or an explicitly permitted initial choice; follow consent setup.
Android initializes from its native Application constructor using the existing handle; iOS initializes
before UIApplication.Main. Do not move mobile initialization into this desktop factory or create
another runtime during UseAppPortal().
For plain content navigation, call primaryContent.ObserveAppPortalNavigation() once at the primary
ContentControl composition root. It records visible control type names, not view-model values or
route input. Prism Region applications use the existing Prism navigation adapter instead of a second
observer on that primary surface. Keep the observer for the content host’s lifetime.
Native lifecycle ownership takes precedence over framework fallback, preventing duplicate transitions. Recovered dispatcher errors do not change the application’s exception handling; fatal capture remains runtime-specific. A managed or headless test does not qualify all desktop/mobile/browser targets, and browser in-memory queues do not promise restart recovery. Keep actual package/host evidence with the first-value check.
After setup
Add useful telemetry covers getting the client, consent, logs, events, managed exceptions, automatic lifecycle tracking, and session investigation. Start there once your framework guide is complete; you do not need to configure the runtime again in each view model or shared library.
Add these integrations when your app uses them:
- Prism logging and optional navigation, using the client initialized by native startup.
- Messaging, for push and Message Center workflows.
- Geofence planning, for app-owned metadata filters and activation windows.
Messaging and Location are source previews. The 3.0.384 NuGet release contains telemetry packages. Check feature availability before evaluating a preview.
Use one app credential for the environment you are connecting.
Finish with one known event and crash/restart check. Keep the resolved package version and actual native host/renderer with the result: a successful managed compile does not qualify every MAUI, Uno or native target. The current guide uses the single Uno integration and one runtime initialized at the native root; framework registration exposes that same client. Follow version notes when an installed release differs rather than replacing working package IDs from an architecture plan.