Exprivia.AsteStg.ErrorReporting.Blazor
1.0.2
dotnet add package Exprivia.AsteStg.ErrorReporting.Blazor --version 1.0.2
NuGet\Install-Package Exprivia.AsteStg.ErrorReporting.Blazor -Version 1.0.2
<PackageReference Include="Exprivia.AsteStg.ErrorReporting.Blazor" Version="1.0.2" />
<PackageVersion Include="Exprivia.AsteStg.ErrorReporting.Blazor" Version="1.0.2" />
<PackageReference Include="Exprivia.AsteStg.ErrorReporting.Blazor" />
paket add Exprivia.AsteStg.ErrorReporting.Blazor --version 1.0.2
#r "nuget: Exprivia.AsteStg.ErrorReporting.Blazor, 1.0.2"
#:package Exprivia.AsteStg.ErrorReporting.Blazor@1.0.2
#addin nuget:?package=Exprivia.AsteStg.ErrorReporting.Blazor&version=1.0.2
#tool nuget:?package=Exprivia.AsteStg.ErrorReporting.Blazor&version=1.0.2
Exprivia.AsteStg.ErrorReporting.Blazor
Componente GlobalErrorBoundary per applicazioni Blazor: intercetta le eccezioni non gestite nell'albero dei componenti, le inoltra a un IErrorReporter (da Exprivia.AsteStg.ErrorReporting.Core) registrato dall'app ospitante, mostra una notifica MudBlazor all'utente e ripristina automaticamente il componente.
Installazione
dotnet add package Exprivia.AsteStg.ErrorReporting.Blazor
Il pacchetto richiede:
Exprivia.AsteStg.ErrorReporting.Core(referenziato automaticamente)MudBlazor— per la notifica (ISnackbar)
Prerequisiti
Nell'app ospitante devono essere registrati:
builder.Services.AddMudServices();
builder.Services.AddScoped<IErrorReporter, MyErrorReporter>(); // implementazione da Exprivia.AsteStg.ErrorReporting.Core
e il MudSnackbarProvider deve essere presente nel layout principale.
Utilizzo
Racchiudere il contenuto dell'app (o di una sezione) nel componente GlobalErrorBoundary:
<GlobalErrorBoundary>
<Router AppAssembly="@typeof(Program).Assembly">
...
</Router>
</GlobalErrorBoundary>
Alla prima eccezione non gestita da un componente figlio, GlobalErrorBoundary:
- invia la segnalazione tramite
IErrorReporter.ReportAsync; - mostra uno snackbar di errore all'utente;
- ripristina automaticamente il boundary dopo un breve ritardo, evitando di bloccare l'interfaccia.
Target Framework
net10.0
Pacchetti correlati
Exprivia.AsteStg.ErrorReporting.Core— astrazioni condivise (IErrorReporter,ErrorReport,ErrorReportBuilder).
| Product | Versions 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. |
-
net10.0
- Exprivia.AsteStg.ErrorReporting.Core (>= 1.0.3)
- MudBlazor (>= 9.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.