BlazorPolyfill.Server 5.0.100.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package BlazorPolyfill.Server --version 5.0.100.5
NuGet\Install-Package BlazorPolyfill.Server -Version 5.0.100.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorPolyfill.Server" Version="5.0.100.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorPolyfill.Server --version 5.0.100.5
#r "nuget: BlazorPolyfill.Server, 5.0.100.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BlazorPolyfill.Server as a Cake Addin
#addin nuget:?package=BlazorPolyfill.Server&version=5.0.100.5

// Install BlazorPolyfill.Server as a Cake Tool
#tool nuget:?package=BlazorPolyfill.Server&version=5.0.100.5

Blazor.Polyfill

Blazor server-side Polyfills and fixes for Internet Explorer 11 & Edge Legacy (EdgeHTML engine).

SUMMARY

INSTALLATION

.NET 5.0+

BlazorPolyfill.Server NuGet package can be either found on nuget.org or from the latest release page on this repository.

  • (Optional) If updating from Blazor.Polyfill 3.0.8, please remove any reference to blazor.polyfill.js or blazor.polyfill.min.js from your _Host.cshtml code, or any static file about the library you would link to in your code, as the library is now embedded is the NuGet package, and managed by _framework/blazor.polyfill.min.js as a magic path.

  • Install the BlazorPolyfill.Server package interactively from the NuGet Package manager in Visual Studio

  • Or install it from the Package Manager CLI with this command:

Install-Package BlazorPolyfill.Server
  • Or additional syntax and possibilities available from the NuGet package page

  • In your _Host.cshtml page, include _framework/blazor.polyfill.min.js file before the _framework/blazor.server.js script tag. The end of your page should look like this:

<script src="_framework/blazor.polyfill.min.js"></script>
<script src="_framework/blazor.server.js"></script>
  • In your Startup.cs file, in your ConfigureServices method, add services.AddBlazorPolyfill() at the end of your services declaration:
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            services.AddSingleton<WeatherForecastService>();
            services.AddBlazorPolyfill();
        }
  • In your Startup.cs file, in your Configure method, add app.UseBlazorPolyfill() just before app.UseStaticFiles():
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            /* Some code */
            app.UseBlazorPolyfill();
            app.UseStaticFiles();
            /* Some code */
        }
  • You are good to go ! Blazor server-side with .NET 5 should be able load on Internet Explorer 11 & Edge

NOTE: blazor.polyfill.js content will be kind of empty automatically if the detected browser, through the user-agent, is something else than Internet Explorer or Edge Legacy.

Additional options

You can configure additional options through the UseBlazorPolyfill method with a BlazorPolyfillOptions object instance or configuration delegate. Here some kind of example:

app.UseBlazorPolyfill(
    (options) => {
        options.ForceES5Fallback = true;
    });

Options:

// If the ForceES5Fallback parameter is set to true,
// the blazor.polyfill.js library content will always be returned
// and the blazor.server.js library will always be transpiled to ES5 with the needed fixes.
 
// If this parameter is set to false, only Internet Explorer 11 and Edge Legacy will have
// the ES5 fallback behavior.
 
// Default value is false.
public bool ForceES5Fallback { get; set; }

.NET 3.1

  • Download the Blazor.Polyfill 3.0.8 release and include the blazor.polyfill.js or blazor.polyfill.min.js file before the blazor.server.js script tag in your wwwroot\index.html or _Host.cshtml file like:
<script type="text/javascript" src="js/blazor.polyfill.min.js"></script>
<script src="_framework/blazor.server.js"></script>

...considering you have copied the file in a wwwroot/js folder.

  • If you want this file to be loaded only if this is Internet Explorer actually running, you may write this instead:
<script type="text/javascript">
    if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
        document.write('<script src="js/blazor.polyfill.min.js"><\/script>');
    }
</script>
<script src="_framework/blazor.server.js"></script>

As documentation is limited on NuGet, full documentation is readable on the Blazor.Polyfill project page

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on BlazorPolyfill.Server:

Repository Stars
ant-design-blazor/ant-design-blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Version Downloads Last updated
7.0.203.1 5,663 4/26/2023
7.0.203 569 4/24/2023
6.0.200 12,921 2/23/2022
6.0.100.3 3,051 12/4/2021
6.0.100.2 1,186 11/21/2021
6.0.100.1 17,251 11/13/2021
6.0.100 886 11/9/2021
5.0.102 26,857 2/1/2021
5.0.100.6 1,490 1/18/2021
5.0.100.5 993 1/5/2021
5.0.100.4 1,047 12/18/2020
5.0.100.2 1,028 12/8/2020
5.0.100.1 904 12/4/2020
5.0.0 1,087 12/2/2020

5.0.100.5:
- Fix dependencies error on Linux (Debian 10 default installation)
- Potentially fix Azure Web App error with the default Linux image container
- Added BlazorPolyfillOptions parameter for UseBlazorPolyfill methods in order to configure additional behaviors at startup
- Added the ForceES5Fallback option in order to force ES5 and Polyfill behaviors even if the browser is not Internet Explorer 11 or Edge Legacy.
- Added ChakraCore engine image and set it as default. V8 engine is still present as fallback engine.

5.0.100.4:
- Fix InputFile Razor component not working on IE11 and possibly some legacy Edge versions.

5.0.100.2:
- Fix possible application crash if request headers do not contains the User-Agent header or value

5.0.100.1:
- Add Edge Legacy (EdgeHTML engine) support
- Fix missing reconnection modal behavior on Internet Explorer 11 and Edge Legacy
- Add pre-caching of all files needed for this library at the first web app request, in order to prevent further requests to wait for file generation on the server before serving the app. This mean that, now, if the app page is shown, then everything is ready.

5.0.0:
- Add .NET 5.0 support