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
<PackageReference Include="Soenneker.Playwrights.Installation" Version="4.0.195" />
<PackageVersion Include="Soenneker.Playwrights.Installation" Version="4.0.195" />
<PackageReference Include="Soenneker.Playwrights.Installation" />
paket add Soenneker.Playwrights.Installation --version 4.0.195
#r "nuget: Soenneker.Playwrights.Installation, 4.0.195"
#:package Soenneker.Playwrights.Installation@4.0.195
#addin nuget:?package=Soenneker.Playwrights.Installation&version=4.0.195
#tool nuget:?package=Soenneker.Playwrights.Installation&version=4.0.195
Soenneker.Playwrights.Installation
Installs a Playwright browser once per application process and configures PLAYWRIGHT_BROWSERS_PATH before Playwright starts.
Related Repos
You might also be interested in:
- soenneker.playwrights.crawler for crawling and mirroring sites to disk with Playwright.
- soenneker.playwrights.extensions.stealth for stealth-oriented Playwright launch and context extensions.
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-shellto the install command. - WithDeps — Passes
--with-deps(install system dependencies). - Browser — Which browser to install:
chromium,firefox, orwebkit. - BrowsersPath — If set, browsers are installed here and
PLAYWRIGHT_BROWSERS_PATHis set to this path. Ifnull, 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__NoShellPlaywright__WithDepsPlaywright__BrowserPlaywright__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 | Versions 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. |
-
net10.0
- Microsoft.Playwright (>= 1.62.0)
- Soenneker.Asyncs.Initializers (>= 4.0.102)
- Soenneker.Enums.DeployEnvironment (>= 4.0.242)
- Soenneker.Extensions.Configuration (>= 4.0.895)
- Soenneker.Utils.Directory (>= 4.0.944)
- Soenneker.Utils.Runtime (>= 4.0.1114)
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 |
Updated Multiple NuGet packages