diff --git a/src/Components/test/testassets/BasicTestApp/Program.cs b/src/Components/test/testassets/BasicTestApp/Program.cs index 5e85aca979..cebb226e7c 100644 --- a/src/Components/test/testassets/BasicTestApp/Program.cs +++ b/src/Components/test/testassets/BasicTestApp/Program.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Globalization; using Microsoft.AspNetCore.Blazor.Hosting; namespace BasicTestApp @@ -9,6 +10,9 @@ namespace BasicTestApp { public static void Main(string[] args) { + // We want the culture to be en-US so that the tests for bind can work consistently. + CultureInfo.CurrentCulture = new CultureInfo("en-US"); + CreateHostBuilder(args).Build().Run(); } diff --git a/src/Components/test/testassets/TestServer/Startup.cs b/src/Components/test/testassets/TestServer/Startup.cs index c7024786d4..4aba67f9f9 100644 --- a/src/Components/test/testassets/TestServer/Startup.cs +++ b/src/Components/test/testassets/TestServer/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Localization; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -76,7 +77,12 @@ namespace TestServer options.AddSupportedCultures("en-US", "fr-FR"); options.AddSupportedUICultures("en-US", "fr-FR"); - // Cookie culture provider is included by default. + // Cookie culture provider is included by default, but we want it to be the only one. + options.RequestCultureProviders.Clear(); + options.RequestCultureProviders.Add(new CookieRequestCultureProvider()); + + // We want the default to be en-US so that the tests for bind can work consistently. + options.SetDefaultCulture("en-US"); }); app.UseRouting();