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
<PackageReference Include="Soenneker.Playwright.Installation" Version="4.0.241" />
<PackageVersion Include="Soenneker.Playwright.Installation" Version="4.0.241" />
<PackageReference Include="Soenneker.Playwright.Installation" />
paket add Soenneker.Playwright.Installation --version 4.0.241
#r "nuget: Soenneker.Playwright.Installation, 4.0.241"
#:package Soenneker.Playwright.Installation@4.0.241
#addin nuget:?package=Soenneker.Playwright.Installation&version=4.0.241
#tool nuget:?package=Soenneker.Playwright.Installation&version=4.0.241
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-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.58.0)
- Soenneker.Asyncs.Initializers (>= 4.0.45)
- Soenneker.Enums.DeployEnvironment (>= 4.0.213)
- Soenneker.Extensions.Configuration (>= 4.0.807)
- Soenneker.Utils.Directory (>= 4.0.835)
- Soenneker.Utils.Runtime (>= 4.0.991)
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 |
Options, readme