Soenneker.Utils.Paths.Resources 11.0.318

Prefix Reserved
dotnet add package Soenneker.Utils.Paths.Resources --version 11.0.318
                    
NuGet\Install-Package Soenneker.Utils.Paths.Resources -Version 11.0.318
                    
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="11.0.318" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Paths.Resources" Version="11.0.318" />
                    
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 11.0.318
                    
#r "nuget: Soenneker.Utils.Paths.Resources, 11.0.318"
                    
#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@11.0.318
                    
#: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=11.0.318
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Paths.Resources&version=11.0.318
                    
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 net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (13)

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
11.0.318 920 11/11/2026
11.0.316 192 11/11/2026
11.0.315 241 11/11/2026
11.0.314 1,104 11/11/2026
11.0.313 948 11/11/2026
11.0.312 609 11/11/2026
11.0.311 912 11/11/2026
11.0.310 10,282 11/3/2026
11.0.309 532 11/3/2026
11.0.308 1,113 11/3/2026
11.0.307 206 11/3/2026
11.0.305 1,623 11/2/2026
11.0.304 178 11/2/2026
11.0.303 13,498 10/26/2026
11.0.302 408 10/26/2026
11.0.301 253 10/26/2026
11.0.300 469 10/26/2026
11.0.299 602 10/26/2026
11.0.298 366 10/26/2026
4.0.297 15,369 10/15/2026
Loading failed

Updated Soenneker.Utils.Directory to 11.0.980