Jimmys20.ProblemDetails
1.0.6
dotnet add package Jimmys20.ProblemDetails --version 1.0.6
NuGet\Install-Package Jimmys20.ProblemDetails -Version 1.0.6
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="Jimmys20.ProblemDetails" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jimmys20.ProblemDetails --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jimmys20.ProblemDetails, 1.0.6"
#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.
// Install Jimmys20.ProblemDetails as a Cake Addin #addin nuget:?package=Jimmys20.ProblemDetails&version=1.0.6 // Install Jimmys20.ProblemDetails as a Cake Tool #tool nuget:?package=Jimmys20.ProblemDetails&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ProblemDetails
Utility library for handling Problem Details error responses in .NET applications.
Installation
Install-Package Jimmys20.ProblemDetails
Usage
Blazor
Program.cs
...
using Jimmys20.ProblemDetails;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddTransient<ProblemDetailsHandler>();
builder.Services
.AddHttpClient("ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<ProblemDetailsHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("ServerAPI"));
await builder.Build().RunAsync();
_Imports.razor
...
@using Jimmys20.ProblemDetails
FetchData.razor
...
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
try
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
}
catch (ProblemDetailsException ex)
{
var problem = ex.Problem;
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.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.