From a196a6a0dbea757266daa3ad68db7845b2fe6c00 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 7 Aug 2020 21:10:02 +0200 Subject: [PATCH] stop using RuntimeInformation.IsOSPlatform(OSPlatform.Browser) (removed in upcoming builds) (#24652) switch back to RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")) --- src/Components/Components/src/PlatformInfo.cs | 2 +- .../src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs | 2 +- .../WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Components/src/PlatformInfo.cs b/src/Components/Components/src/PlatformInfo.cs index 2ed3ace3b9..e1de5ff13b 100644 --- a/src/Components/Components/src/PlatformInfo.cs +++ b/src/Components/Components/src/PlatformInfo.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components static PlatformInfo() { - IsWebAssembly = RuntimeInformation.IsOSPlatform(OSPlatform.Browser); + IsWebAssembly = RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); } } } diff --git a/src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs b/src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs index 89ed322562..71a06a15ec 100644 --- a/src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs +++ b/src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Components.Web.Extensions protected ProtectedBrowserStorage(string storeName, IJSRuntime jsRuntime, IDataProtectionProvider dataProtectionProvider) { // Performing data protection on the client would give users a false sense of security, so we'll prevent this. - if (RuntimeInformation.IsOSPlatform(OSPlatform.Browser)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))) { throw new PlatformNotSupportedException($"{GetType()} cannot be used when running in a browser."); } diff --git a/src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs b/src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs index 74e6ee705f..709c0f576c 100644 --- a/src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs +++ b/src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.Services /// A list of the loaded public async Task> LoadAssembliesAsync(IEnumerable assembliesToLoad) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Browser)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))) { return await LoadAssembliesInClientAsync(assembliesToLoad); }