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
                    
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.Utils.Paths.Resources" Version="4.0.264" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Paths.Resources" Version="4.0.264" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.Paths.Resources" />
                    
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.Utils.Paths.Resources --version 4.0.264
                    
#r "nuget: Soenneker.Utils.Paths.Resources, 4.0.264"
                    
#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.Utils.Paths.Resources@4.0.264
                    
#: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.Utils.Paths.Resources&version=4.0.264
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Paths.Resources&version=4.0.264
                    
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

alternate text is missing from this package README image 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:

  1. Existing directory from RESOURCES_DIR.
  2. Resources beside the running application's base directory.
  3. Azure HOME/site/wwwroot/Resources for Functions or App Service.
  4. A Resources directory found from the current directory within a GitHub Actions workspace, then <GITHUB_WORKSPACE>/Resources.
  5. A Resources directory found by walking upward from the current directory.
  6. HOME/site/wwwroot/Resources outside Azure.
  7. The application-base Resources path 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 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 (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
Loading failed

Remove unused dependencies and declare direct package references