Soenneker.Playwright.Installation 4.0.241

Prefix Reserved
dotnet add package Soenneker.Playwright.Installation --version 4.0.241
                    
NuGet\Install-Package Soenneker.Playwright.Installation -Version 4.0.241
                    
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="Soenneker.Playwright.Installation" Version="4.0.241" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Playwright.Installation" Version="4.0.241" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Playwright.Installation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Playwright.Installation --version 4.0.241
                    
#r "nuget: Soenneker.Playwright.Installation, 4.0.241"
                    
#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.
#:package Soenneker.Playwright.Installation@4.0.241
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Playwright.Installation&version=4.0.241
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Playwright.Installation&version=4.0.241
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Playwright.Installation

Makes sure Playwright’s browser (e.g. Chromium) is installed before you use it. It runs the install once, sets the browser path, and you’re done.


Quick start

1. Install the package

dotnet add package Soenneker.Playwright.Installation

2. Register the util (e.g. in Program.cs or your service setup)

services.AddPlaywrightInstallationUtilAsSingleton();

3. Before using Playwright, ensure it’s installed

var playwrightUtil = serviceProvider.GetRequiredService<IPlaywrightInstallationUtil>();
await playwrightUtil.EnsureInstalled();
// Now use Playwright as usual.

The first call to EnsureInstalled() installs the browser if needed. Later calls do nothing. You only need to call it once per process.


Changing how it installs (optional)

By default the util installs Chromium with --no-shell and --with-deps. To change that, call SetOptions before the first EnsureInstalled():

playwrightUtil.SetOptions(new PlaywrightInstallationOptions
{
    NoShell = true,           // default: true
    WithDeps = true,          // default: true
    Browser = "chromium",     // or "firefox", "webkit"
    BrowsersPath = null       // optional custom folder for browsers
});

await playwrightUtil.EnsureInstalled();
  • NoShell — Passes --no-shell to the install command.
  • WithDeps — Passes --with-deps (install system dependencies).
  • Browser — Which browser to install: chromium, firefox, or webkit.
  • BrowsersPath — If set, browsers are installed here and PLAYWRIGHT_BROWSERS_PATH is set to this path. If null, a default path is used (see below).

Where browsers are installed

If you don’t set BrowsersPath, the util uses a default directory. You can get that path with:

string path = playwrightUtil.GetPlaywrightPath();

On Azure App Service it uses a path under the app root. Elsewhere it uses a .playwright folder under your app’s base directory.


Using config instead of code (optional)

You can drive the same options from configuration so you don’t have to call SetOptions in code. If the Playwright config section exists, the util uses it when you haven’t called SetOptions.

appsettings.json

{
  "Playwright": {
    "NoShell": true,
    "WithDeps": true,
    "Browser": "chromium",
    "BrowsersPath": null
  }
}

Environment variables (use double underscore for the section name)

  • Playwright__NoShell
  • Playwright__WithDeps
  • Playwright__Browser
  • Playwright__BrowsersPath

Anything you set via SetOptions overrides config. If you never call SetOptions and there’s no Playwright section, the defaults (Chromium, no-shell, with-deps, default path) are used.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Playwright.Installation:

Package Downloads
Soenneker.Cloudflare.Downloader

Allows for navigating and downloading from Cloudflare sites in under-attack mode

Soenneker.TrustedForm.Runners.OpenApi.Certificates

Automatically updates the Soenneker.TrustedForm.OpenApi.Certificates package

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.241 0 3/15/2026
4.0.240 0 3/15/2026
4.0.239 18 3/15/2026
4.0.238 25 3/15/2026
4.0.237 79 3/14/2026
4.0.236 54 3/14/2026
4.0.235 34 3/14/2026
4.0.234 35 3/13/2026
4.0.233 37 3/13/2026
4.0.232 32 3/13/2026
4.0.230 131 3/13/2026
4.0.229 34 3/13/2026
4.0.228 34 3/13/2026
4.0.227 55 3/12/2026
4.0.226 39 3/12/2026
4.0.225 32 3/12/2026
4.0.224 37 3/12/2026
4.0.223 34 3/12/2026
4.0.222 35 3/12/2026
4.0.221 35 3/12/2026
Loading failed

Options, readme