You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -92,12 +92,12 @@ The `IWebAssemblyHostEnvironment.BaseAddress` property can be used during startu
92
92
93
93
### Configuration
94
94
95
-
Blazor WebAssembly supports configuration from:
95
+
Blazor WebAssembly loads configuration from:
96
96
97
-
*The [File Configuration Provider](xref:fundamentals/configuration/index#file-configuration-provider) for app settings files by default:
97
+
*App settings files by default:
98
98
**wwwroot/appsettings.json*
99
99
**wwwroot/appsettings.{ENVIRONMENT}.json*
100
-
* Other [configuration providers](xref:fundamentals/configuration/index) registered by the app.
100
+
* Other [configuration providers](xref:fundamentals/configuration/index) registered by the app. Not all providers are appropriate for Blazor WebAssembly apps. Clarification on which providers are supported for Blazor WebAssembly is tracked by [Clarify configuration providers for Blazor WASM (dotnet/AspNetCore.Docs #18134)](https://github.com/dotnet/AspNetCore.Docs/issues/18134).
101
101
102
102
> [!WARNING]
103
103
> Configuration in a Blazor WebAssembly app is visible to users. **Don't store app secrets or credentials in configuration.**
@@ -128,12 +128,12 @@ Inject an <xref:Microsoft.Extensions.Configuration.IConfiguration> instance into
128
128
129
129
#### Provider configuration
130
130
131
-
The following example uses a <xref:Microsoft.Extensions.Configuration.Memory.MemoryConfigurationSource>and the [File Configuration Provider](xref:fundamentals/configuration/index#file-configuration-provider)to supply additional configuration:
131
+
The following example uses a <xref:Microsoft.Extensions.Configuration.Memory.MemoryConfigurationSource> to supply additional configuration:
132
132
133
133
`Program.Main`:
134
134
135
135
```csharp
136
-
usingMicrosoft.Extensions.Configuration;
136
+
usingMicrosoft.Extensions.Configuration.Memory;
137
137
138
138
...
139
139
@@ -151,9 +151,7 @@ var memoryConfig = new MemoryConfigurationSource { InitialData = vehicleData };
@@ -181,6 +179,36 @@ Inject an <xref:Microsoft.Extensions.Configuration.IConfiguration> instance into
181
179
}
182
180
```
183
181
182
+
To read other configuration files from the *wwwroot* folder into configuration, use an `HttpClient` to obtain the file's content. When using this approach, the existing `HttpClient` service registration can use the local client created to read the file, as the following example shows:
0 commit comments