Skip to content

Repository files navigation

Nuget packages for Microsoft WebView2 Fixed Runtime Distribution

Nuget packages:

PlatformArchitecturePackage NameVersionDownloads
WindowsX86WebView2.Runtime.X86
WebView2.Runtime.X86.Core
NuGet
NuGet
NuGet
NuGet
WindowsX64WebView2.Runtime.X64
WebView2.Runtime.X64.Core
NuGet
NuGet
NuGet
NuGet
WindowsARM64WebView2.Runtime.ARM64
WebView2.Runtime.ARM64.Core
NuGet
NuGet
NuGet
NuGet
WindowsAnyWebView2.Runtime.LocalesNuGetNuGet
WindowsAnyWebView2.Runtime.AutoInstallerNuGetNuGet

WebView2.Runtime.Core

Since version 152.0.4191.53 WebView2 no more fits in nuget limit of 250 megabytes, so to somehow fit in this limit now it splitted into 2 packages. Now you REQUIRE to install both WebView2.Runtime.Arch and WebView2.Runtime.Arch.Core packages.

WebView2.Runtime.Locales

Since version 137.0.3296.52 WebView2 no more fits in nuget limit of 250 megabytes, so to reduce package size runtime now contains only english language. If you want all others languages, just install WebView2.Runtime.Locales package.

Runtime packages usage example:

  1. Install via nuget selected architecture package. (It's nesessary to install both packages!)
Install-Package WebView2.Runtime.X64
Install-Package WebView2.Runtime.X64.Core
  1. Make sure what in you project appears folder WebView2 and all files marked as "Copy To Output".
  2. Initialize webview2 before usage, path must be to WebView2 directory. In most cases it must be in application directory.
varwebView=newWebView2(){Dock=DockStyle.Fill};awaitwebView.EnsureCoreWebView2Async(awaitCoreWebView2Environment.CreateAsync(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"WebView2")));Controls.Add(webView);webView.CoreWebView2.Navigate("https://nuget.org/");

Automate runtime installer example:

You can use package WebView2.Runtime.AutoInstaller to check current WebView2 runtime installed status and automate install it.

This type of installation requires running the program as an administrator (or installer will request them independently) and ethernet connection.

Source of this library you can find here.

  1. Install via nuget.
Install-Package WebView2.Runtime.AutoInstaller
  1. Use
// Check and install if not installedawaitWebView2AutoInstaller.CheckAndInstallAsync();// Only check, return true or falseawaitWebView2AutoInstaller.CheckAndInstallAsync(true);// Show runtime installer windowawaitWebView2AutoInstaller.CheckAndInstallAsync(false,false);// Set custom path to runtime installer (maybee you put it into application resources).awaitWebView2AutoInstaller.CheckAndInstallAsync(false,false,"path");

Samples

You can found samples in Samples directory. Also check official microsoft edge samples repository.

Build nupkg:

  1. Clone repository.
  2. Run build.ps1 and wait.
  3. Or if you want to build with different WebView2 version download .cab files from fixed version section and put in build directory (as in picture) - https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section.

alt text

Used tools:

  1. nuget.exe - nuget package builder.
  2. expand.exe - tool for unpack .cab files (taked from windows 11 system32 directory).

About

Webview2 runtime nuget packages for Fixed Version distribution.

Resources

Stars

43 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages