diff --git a/aspnetcore/blazor/webassembly-build-tools-and-aot.md b/aspnetcore/blazor/webassembly-build-tools-and-aot.md index 3674468d0c25..fcbbac9bc746 100644 --- a/aspnetcore/blazor/webassembly-build-tools-and-aot.md +++ b/aspnetcore/blazor/webassembly-build-tools-and-aot.md @@ -47,7 +47,8 @@ The following list shows which workload to install for each .NET SDK, depending * Targeting .NET 8 requires `wasm-tools-net8`. * Using the .NET 8 SDK: Targeting .NET 8 requires `wasm-tools`. -The Emscripten compiler toolchain depends on [LLVM](https://llvm.org/), [Node.js](https://nodejs.org), and [Python](https://www.python.org/), which are installed by default with the .NET WebAssembly build tools workload on Windows and macOS. Python isn't installed for Linux users by default, so Linux users should [download Python for Linux/Unix](https://www.python.org/downloads/source/) and manually install it on their system. +The Emscripten compiler toolchain depends on [Python](https://www.python.org/), which is bundled by default with the .NET WebAssembly build tools workload on Windows and macOS. +Python isn't bundled for Linux users, resulting in "unable to find python in $PATH" errors if Python isn't available. Linux users should install Python through their package manager or [download Python for Linux/Unix](https://www.python.org/downloads/source/) and manually install it on their system so that it is available in `$PATH`. ## Ahead-of-time (AOT) compilation diff --git a/aspnetcore/fundamentals/configuration/index.md b/aspnetcore/fundamentals/configuration/index.md index aa5ac07d22d6..e9d5ec51b827 100644 --- a/aspnetcore/fundamentals/configuration/index.md +++ b/aspnetcore/fundamentals/configuration/index.md @@ -5,7 +5,7 @@ description: Learn how to use the Configuration API to configure app settings in monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 01/22/2026 +ms.date: 01/23/2026 uid: fundamentals/configuration/index --- # Configuration in ASP.NET Core @@ -234,14 +234,14 @@ public class Startup public void ConfigureServices(IServiceCollection services) { - var connectionString = Config["ConnectionStrings.DefaultConnection"]}"); + var connectionString = Config["ConnectionStrings.DefaultConnection"]; ... } public void Configure(...) { - var defaultLogLevel = Config["Logging:LogLevel:Default"]}"); + var defaultLogLevel = Config["Logging:LogLevel:Default"]; ... } @@ -306,23 +306,23 @@ The Configuration API reads hierarchical configuration data by flattening the hi Consider the following hierarchical configuration data: * :::no-loc text="ConnectionStrings"::: - * :::no-loc text="DefaultConnection (Value = ":::no-loc text="Data Source=LocalSqlServer\\MSSQLDev;":::") + * :::no-loc text="DefaultConnection (Value = 'Data Source=LocalSqlServer\\MSSQLDev;')"::: * :::no-loc text="Logging"::: * :::no-loc text="LogLevel"::: - * :::no-loc text="Default"::: (Value = :::no-loc text="Information":::) - * :::no-loc text="Microsoft"::: (Value = :::no-loc text="Warning":::) - * :::no-loc text="Microsoft.Hosting.Lifetime"::: (Value = :::no-loc text="Information":::) -* :::no-loc text="AllowedHosts"::: (Value = *) + * :::no-loc text="Default (Value = 'Information')"::: + * :::no-loc text="Microsoft (Value = 'Warning')"::: + * :::no-loc text="Microsoft.Hosting.Lifetime (Value = 'Information')"::: +* :::no-loc text="AllowedHosts (Value = '*')"::: The following table displays the keys used to recover the values in the preceding configuration data. The delimiter isn't required for :::no-loc text="AllowedHosts":::. Key (colon delimiter) | Key (double-underscore delimiter) --- | --- -ConnectionStrings:DefaultConnection | ConnectionStrings__DefaultConnection -Logging:LogLevel:Default | Logging__LogLevel__Default -Logging:LogLevel:Microsoft | Logging__LogLevel__Microsoft -Logging:LogLevel:Microsoft.Hosting.Lifetime | Logging__LogLevel__Microsoft.Hosting.Lifetime -AllowedHosts | AllowedHosts +`ConnectionStrings:DefaultConnection` | `ConnectionStrings__DefaultConnection` +`Logging:LogLevel:Default` | `Logging__LogLevel__Default` +`Logging:LogLevel:Microsoft` | `Logging__LogLevel__Microsoft` +`Logging:LogLevel:Microsoft.Hosting.Lifetime` | `Logging__LogLevel__Microsoft.Hosting.Lifetime` +`AllowedHosts` | `AllowedHosts` > [!NOTE] > In complex app configuration scenarios, we recommend grouping and reading related hierarchical configuration data using the [Options pattern](xref:fundamentals/configuration/options). @@ -416,7 +416,7 @@ Provider | Provides configuration from… [Custom configuration provider](#custom-configuration-provider) | Custom source [Environment Variables Configuration Provider](#environment-variables-configuration-provider) | Environment variables [File Configuration Provider](#file-configuration-provider) | INI, JSON, and XML files -[Key-per-file Configuration Provider](#key-per-file-configuration-provider) | Directory files +[Key-Per-File Configuration Provider](#key-per-file-configuration-provider) | Directory files [Memory Configuration Provider](#memory-configuration-provider) | In-memory collections [User secrets](xref:security/app-secrets) | File in the user profile directory @@ -986,9 +986,9 @@ The previous configuration loads the following keys with `value`: * `key:attribute` * `section:key:attribute` -## Key-per-file Configuration Provider +## Key-Per-File Configuration Provider -The uses a directory's files as configuration key-value pairs. The key is the file name. The value contains the file's contents. The Key-per-file Configuration Provider is used in Docker hosting scenarios. +The uses a directory's files as configuration key-value pairs. The key is the file name. The value contains the file's contents. The Key-Per-File Configuration Provider is used in Docker hosting scenarios. To activate key-per-file configuration, call the extension method on an instance of . The `directoryPath` to the files must be an absolute path. @@ -1203,10 +1203,10 @@ spaces at the ends of the lines when editing the following content. --> -> no-loc text="subsection0:key0 value: value200"::: -> no-loc text="subsection0:key1 value: value201"::: -> no-loc text="subsection1:key0 value: value210"::: -> no-loc text="subsection1:key1 value: value211"::: +> :::no-loc text="subsection0:key0 value: value200"::: +> :::no-loc text="subsection0:key1 value: value201"::: +> :::no-loc text="subsection1:key0 value: value210"::: +> :::no-loc text="subsection1:key1 value: value211"::: ## Bind an array @@ -1381,7 +1381,7 @@ public class Program { config.AddInMemoryCollection(arrayDict); config.AddJsonFile("Value3.json", - optional: false, reloadOnChange: false); + optional: false, reloadOnChange: false); }) .ConfigureWebHostDefaults(webBuilder => { @@ -1529,36 +1529,31 @@ Create the custom configuration provider by inheriting from optionsAction) - { - OptionsAction = optionsAction; - } - - Action OptionsAction { get; } +using Microsoft.EntityFrameworkCore; +public class EFConfigurationProvider(Action optionsAction) : ConfigurationProvider +{ public override void Load() { var builder = new DbContextOptionsBuilder(); - OptionsAction(builder); + optionsAction(builder); - using (var dbContext = new EFConfigurationContext(builder.Options)) - { - if (dbContext == null || dbContext.Values == null) - { - throw new Exception("Null DB context"); - } - dbContext.Database.EnsureCreated(); + using var dbContext = new EFConfigurationContext(builder.Options); - Data = !dbContext.Values.Any() - ? CreateAndSaveDefaultValues(dbContext) - : dbContext.Values.ToDictionary(c => c.Id, c => c.Value); + if (dbContext == null || dbContext.Values == null) + { + throw new Exception("Null DB context"); } + + dbContext.Database.EnsureCreated(); + + Data = !dbContext.Values.Any() + ? CreateAndSaveDefaultValues(dbContext) + : dbContext.Values.ToDictionary(c => c.Id, c => c.Value); } - private static IDictionary CreateAndSaveDefaultValues( + private static Dictionary CreateAndSaveDefaultValues( EFConfigurationContext dbContext) { // Quotes (c)2005 Universal Pictures: Serenity @@ -1566,9 +1561,9 @@ public class EFConfigurationProvider : ConfigurationProvider var configValues = new Dictionary(StringComparer.OrdinalIgnoreCase) { - { "quote1", "I aim to misbehave." }, - { "quote2", "I swallowed a bug." }, - { "quote3", "You can't stop the signal, Mal." } + { "quote1", "I aim to misbehave." }, + { "quote2", "I swallowed a bug." }, + { "quote3", "You can't stop the signal, Mal." } }; if (dbContext == null || dbContext.Values == null) @@ -1674,8 +1669,8 @@ An `AddEFConfiguration` extension method permits adding the configuration source public static class EntityFrameworkExtensions { public static IConfigurationBuilder AddEFConfiguration( - this IConfigurationBuilder builder, - Action optionsAction) + this IConfigurationBuilder builder, + Action optionsAction) { return builder.Add(new EFConfigurationSource(optionsAction)); } diff --git a/aspnetcore/fundamentals/logging/index.md b/aspnetcore/fundamentals/logging/index.md index 69050738b727..75239357f010 100644 --- a/aspnetcore/fundamentals/logging/index.md +++ b/aspnetcore/fundamentals/logging/index.md @@ -6,7 +6,7 @@ description: Learn how to use the ASP.NET Core logging framework provided by the monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 01/15/2026 +ms.date: 01/23/2026 uid: fundamentals/logging/index --- # Logging in .NET and ASP.NET Core @@ -541,18 +541,14 @@ The following `Counter` component logs from the `IncrementByOne` method with the private void IncrementByOne() { var logger = Logger.CreateLogger($"{typeof(Counter)}.IncrementByOne"); - Logger.LogInformation("Someone incremented the counter!"); - currentCount++; } private void IncrementByTen() { var logger = Logger.CreateLogger($"{typeof(Counter)}.IncrementByTen"); - Logger.LogInformation("Someone incremented the counter!"); - currentCount += 10; } } @@ -819,7 +815,7 @@ public async Task GetTodoItem(long id) using (Logger.BeginScope(new List> { - new KeyValuePair("TransactionId", transactionId), + new("TransactionId", transactionId), })) { Logger.LogInformation(LogEvent.GetItem, "Getting item {Id}", id); diff --git a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md index c5f396a47e72..0ecfc4acf6f3 100644 --- a/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md +++ b/aspnetcore/release-notes/aspnetcore-10/includes/blazor.md @@ -209,7 +209,7 @@ Files are placed into the import map: When resolving the import for JavaScript interop, the import map is used by the browser resolve fingerprinted files. -## Preloaded Blazor framework static assets +### Preloaded Blazor framework static assets In Blazor Web Apps, framework static assets are automatically preloaded using [`Link` headers](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Link), which allows the browser to preload resources before the initial page is fetched and rendered. @@ -229,6 +229,8 @@ In standalone Blazor WebAssembly apps, framework assets are scheduled for high p ``` +For more information, see . + ### Set the environment in standalone Blazor WebAssembly apps The `Properties/launchSettings.json` file is no longer used to control the environment in standalone Blazor WebAssembly apps. @@ -407,12 +409,6 @@ New performance profiling and diagnostic counters are available for Blazor WebAs * * -### Preloaded Blazor framework static assets - -In Blazor Web Apps, framework static assets are automatically preloaded using [`Link` headers](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Link), which allows the browser to preload resources before the initial page is fetched and rendered. In standalone Blazor WebAssembly apps, framework assets are scheduled for high priority downloading and caching early in browser `index.html` page processing. - -For more information, see . - ### Opt-in to avoiding a `NavigationException` during static server-side rendering with `NavigationManager.NavigateTo` Calling during static server-side rendering (static SSR) throws a , interrupting execution before being converted to a redirection response. This can cause confusion during debugging and is inconsistent with interactive rendering behavior, where code after continues to execute normally.