Soenneker.Playwrights.Installation 4.0.195

Prefix Reserved
dotnet add package Soenneker.Playwrights.Installation --version 4.0.195
                    
NuGet\Install-Package Soenneker.Playwrights.Installation -Version 4.0.195
                    
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.Playwrights.Installation" Version="4.0.195" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Playwrights.Installation" Version="4.0.195" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Playwrights.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.Playwrights.Installation --version 4.0.195
                    
#r "nuget: Soenneker.Playwrights.Installation, 4.0.195"
                    
#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.Playwrights.Installation@4.0.195
                    
#: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.Playwrights.Installation&version=4.0.195
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Playwrights.Installation&version=4.0.195
                    
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.Playwrights.Installation

Installs a Playwright browser once per application process and configures PLAYWRIGHT_BROWSERS_PATH before Playwright starts.

You might also be interested in:


Quick start

1. Install the package

dotnet add package Soenneker.Playwrights.Installation

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

using Soenneker.Playwrights.Installation.Registrars;

services.AddPlaywrightInstallationUtilAsSingleton();

3. Before creating Playwright, ensure the browser is installed

using Soenneker.Playwrights.Installation.Abstract;

var playwrightUtil = serviceProvider.GetRequiredService<IPlaywrightInstallationUtil>();
await playwrightUtil.EnsureInstalled();

using IPlaywright playwright = await Playwright.CreateAsync();

When supplying launch options, pass the same instance to the installer and Playwright. This ensures the required Chromium artifact is installed—for example, default headless mode requires Chromium's separate headless shell:

var launchOptions = new BrowserTypeLaunchOptions
{
    Headless = true
};

await playwrightUtil.EnsureInstalled(launchOptions);

using IPlaywright playwright = await Playwright.CreateAsync();
await using IBrowser browser = await playwright.Chromium.LaunchAsync(launchOptions);

The first call to EnsureInstalled() runs Playwright's installer. Concurrent and later calls share that initialization. Register the utility as a singleton when the application uses one process-wide browser directory.


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():

using Soenneker.Playwrights.Installation.Abstract;
using Soenneker.Playwrights.Installation.Options;

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();

Options are frozen when EnsureInstalled() begins; changing them afterward throws InvalidOperationException.

  • 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 (4)

Showing the top 4 NuGet packages that depend on Soenneker.Playwrights.Installation:

Package Downloads
Soenneker.Cloudflare.Downloader

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

Soenneker.Playwrights.Crawler

A configurable Playwright crawler with rich stealth and control options.

Soenneker.Playwrights.TestEnvironment

A test environment for testing with Playwright

Soenneker.Pdfs.Html

A utility library for generating PDF documents from HTML using Playwright.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.195 285 9/16/2026
4.0.194 60 9/16/2026
4.0.193 79 9/16/2026
4.0.192 47 9/16/2026
4.0.191 188 9/15/2026
4.0.190 827 9/13/2026
4.0.189 136 9/13/2026
4.0.188 318 9/13/2026
4.0.187 85 9/13/2026
4.0.186 206 9/13/2026
4.0.185 277 9/12/2026
4.0.184 140 9/12/2026
4.0.183 85 9/12/2026
4.0.180 683 9/9/2026
4.0.179 224 9/9/2026
4.0.178 202 9/9/2026
4.0.177 92 9/9/2026
4.0.176 196 9/8/2026
4.0.175 199 9/8/2026
4.0.174 370 9/8/2026
Loading failed

Updated Multiple NuGet packages