Soenneker.Utils.Paths.Resources
4.0.264
Prefix Reserved
dotnet add package Soenneker.Utils.Paths.Resources --version 4.0.264
NuGet\Install-Package Soenneker.Utils.Paths.Resources -Version 4.0.264
<PackageReference Include="Soenneker.Utils.Paths.Resources" Version="4.0.264" />
<PackageVersion Include="Soenneker.Utils.Paths.Resources" Version="4.0.264" />
<PackageReference Include="Soenneker.Utils.Paths.Resources" />
paket add Soenneker.Utils.Paths.Resources --version 4.0.264
#r "nuget: Soenneker.Utils.Paths.Resources, 4.0.264"
#:package Soenneker.Utils.Paths.Resources@4.0.264
#addin nuget:?package=Soenneker.Utils.Paths.Resources&version=4.0.264
#tool nuget:?package=Soenneker.Utils.Paths.Resources&version=4.0.264
Soenneker.Utils.Paths.Resources
Resolves an application's Resources directory across local, Azure, and GitHub Actions environments and safely constructs paths beneath it.
Installation
dotnet add package Soenneker.Utils.Paths.Resources
Quick start
using Soenneker.Utils.Paths.Resources.Registrars;
services.AddResourcesPathUtilAsSingleton();
Then inject IResourcesPathUtil wherever you need it.
Resolve the Resources directory
string resourcesDirectory = await resourcesPathUtil.Get(cancellationToken);
string templatePath = await resourcesPathUtil.GetResourceFilePath(
Path.Combine("Templates", "invoice.html"),
cancellationToken);
GetResourceFilePath accepts a relative file or nested path and guarantees the normalized result
stays beneath the resolved Resources directory. Rooted paths and .. traversal outside that
directory throw InvalidOperationException. The method only constructs a path; it does not require
the file to exist.
The directory is resolved in this order:
- Existing directory from
RESOURCES_DIR. Resourcesbeside the running application's base directory.- Azure
HOME/site/wwwroot/Resourcesfor Functions or App Service. - A
Resourcesdirectory found from the current directory within a GitHub Actions workspace, then<GITHUB_WORKSPACE>/Resources. - A
Resourcesdirectory found by walking upward from the current directory. HOME/site/wwwroot/Resourcesoutside Azure.- The application-base
Resourcespath as a last resort, even when it does not exist.
Resolution never creates the directory. The first result is cached by each utility instance, so changes to environment variables, the current directory, or the filesystem are not observed by later calls on that instance. Singleton registration shares that cached decision application-wide; scoped registration resolves once per scope.
| 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
- Soenneker.Atomics.Strings (>= 4.0.22)
- Soenneker.Extensions.ValueTask (>= 4.0.123)
- Soenneker.Utils.Directory (>= 4.0.944)
- Soenneker.Utils.Runtime (>= 4.0.1114)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on Soenneker.Utils.Paths.Resources:
| Package | Downloads |
|---|---|
|
Soenneker.Git.Util
Asynchronous Git operations, repository discovery, and bounded batch processing using bundled Git distributions. |
|
|
Soenneker.Validators.Email.Disposable
Checks whether an email address uses a disposable or temporary domain. |
|
|
Soenneker.Validators.ZipCode.Exists
Validates US ZIP codes against a packaged data snapshot |
|
|
Soenneker.Compression.SevenZip
A utility library for 7zip compression related operations |
|
|
Soenneker.Cloudflare.Validators.Request
Validates ASP.NET Core client certificates against Cloudflare's Authenticated Origin Pull CA. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.264 | 0 | 9/24/2026 |
| 4.0.263 | 6,328 | 9/16/2026 |
| 4.0.262 | 459 | 9/16/2026 |
| 4.0.261 | 1,374 | 9/16/2026 |
| 4.0.260 | 607 | 9/15/2026 |
| 4.0.259 | 6,823 | 9/13/2026 |
| 4.0.258 | 197 | 9/13/2026 |
| 4.0.257 | 461 | 9/13/2026 |
| 4.0.256 | 158 | 9/13/2026 |
| 4.0.255 | 1,196 | 9/13/2026 |
| 4.0.254 | 1,191 | 9/12/2026 |
| 4.0.251 | 7,928 | 9/9/2026 |
| 4.0.250 | 1,983 | 9/9/2026 |
| 4.0.249 | 386 | 9/9/2026 |
| 4.0.248 | 1,100 | 9/8/2026 |
| 4.0.247 | 2,959 | 9/8/2026 |
| 4.0.246 | 1,578 | 9/8/2026 |
| 4.0.245 | 465 | 9/8/2026 |
| 4.0.242 | 2,700 | 9/7/2026 |
| 4.0.241 | 811 | 9/7/2026 |
Remove unused dependencies and declare direct package references