Request ID: @RequestId
Swapping to Development environment will display more detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.
@code{ [CascadingParameter] private HttpContext? HttpContext { get; set; } private string? RequestId { get; set; } private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); protected override void OnInitialized() => RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; } ================================================ FILE: BlazorWebApp/BlazorWebApp/Components/_Imports.razor ================================================ @using System.Net.Http @using System.Net.Http.Json @using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web @using static Microsoft.AspNetCore.Components.Web.RenderMode @using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.JSInterop @using BlazorWebApp @using BlazorWebApp.Client @using BlazorWebApp.Components ================================================ FILE: BlazorWebApp/BlazorWebApp/Program.cs ================================================ using BlazorWebApp.Client; using BlazorWebApp.Components; using BlazorPro.BlazorSize; using TestComponents; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorComponents() .AddInteractiveServerComponents() .AddInteractiveWebAssemblyComponents(); builder.Services.AddResizeListener(); builder.Services.AddMediaQueryService(); builder.Services.AddScopedSwapping to Development environment will display more detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.
================================================ FILE: TestComponents/Pages/FetchData.razor ================================================ @inject IWeatherForecastService Forecasts @using TestComponents @page "/fetchdata"This component demonstrates adaptive rendering of a Blazor UI.
@if (IsSmall) {This component demonstrates adaptive rendering of a Blazor UI.
Loading...
} else { foreach (var t in Data.Select((x,i) => new { Forecast = x, Index = i })) {@t.Forecast.TemperatureC (C) / @t.Forecast.TemperatureF (F)
@t.Forecast.Summary
Loading...
} else {| Date | Temp. (C) | Temp. (F) | Summary |
|---|---|---|---|
| @forecast.Date.ToShortDateString() | @forecast.TemperatureC | @forecast.TemperatureF | @forecast.Summary |