Soenneker.Utils.File 4.0.2231

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.File --version 4.0.2231
                    
NuGet\Install-Package Soenneker.Utils.File -Version 4.0.2231
                    
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.File" Version="4.0.2231" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.File" Version="4.0.2231" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.File" />
                    
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.File --version 4.0.2231
                    
#r "nuget: Soenneker.Utils.File, 4.0.2231"
                    
#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.File@4.0.2231
                    
#: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.File&version=4.0.2231
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.File&version=4.0.2231
                    
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.File

A utility library encapsulating asynchronous file IO operations.

Installation

dotnet add package Soenneker.Utils.File

Quick start

using Soenneker.Utils.File.Registrars;

services.AddFileUtilAsSingleton();

Then inject IFileUtil wherever you need it.

Common operations

  • Read() - Reads the entire content of a file as a string. Returns a task containing the file content as a string.
  • TryRead() - Tries to read the content of a file as a string. Logs a warning on failure. Returns a task containing the file content as a string or null on failure.
  • ReadAsLines() - Reads the entire content of a file as a list of strings, where each line is an item in the list. Returns a task containing a list of strings representing the file's lines.
  • ReadToBytes() - Reads the entire content of a file as a byte array. Returns a task containing the file content as a byte array.
  • ReadToMemoryStream() - Reads the entire content of a file into a memory stream. Returns a task containing a memory stream with the file content.
  • Write() - Writes a string to a file. Returns a task representing the operation.
  • WriteAllLines() - Writes all lines of text to a file. Returns a task representing the operation.
  • Append() - Appends text to the end of an existing file, creating the file if it does not exist. Returns a ValueTask that completes when the write finishes.
  • Copy() - Copies a file from one path to another. Returns a task representing the operation.
  • Move() - Moves a file from one path to another. Deletes the source file after copying. Returns a task representing the operation.
  • Delete() - Deletes the specified file if it exists. Returns a ValueTask that completes when the deletion (if any) finishes.
  • Exists() - Checks whether a file exists at the given path.

The package also includes 18 additional operations for more specialized cases.

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 (31)

Showing the top 5 NuGet packages that depend on Soenneker.Utils.File:

Package Downloads
Soenneker.Utils.Json

Serializes, deserializes, validates, formats, and writes JSON with System.Text.Json or Newtonsoft.Json.

Soenneker.Git.Util

Asynchronous Git operations, repository discovery, and bounded batch processing using bundled Git distributions.

Soenneker.Utils.Dotnet

A utility library for the dotnet executable

Soenneker.Google.Credentials

An async thread-safe singleton for Google OAuth credentials

Soenneker.GitHub.Repositories.Releases

Creates, retrieves, deletes, uploads, and downloads GitHub releases and assets

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2242 0 8/31/2026
4.0.2241 0 8/31/2026
4.0.2240 117 8/31/2026
4.0.2239 174 8/31/2026
4.0.2238 75 8/30/2026
4.0.2237 417 8/30/2026
4.0.2235 2,875 8/30/2026
4.0.2234 2,497 8/30/2026
4.0.2233 38 8/30/2026
4.0.2232 109 8/30/2026
4.0.2231 1,126 8/29/2026
4.0.2230 5,843 8/29/2026
4.0.2228 65 8/29/2026
4.0.2227 255 8/29/2026
4.0.2226 24,100 8/26/2026
4.0.2223 12,741 8/22/2026
4.0.2222 1,045 8/22/2026
4.0.2221 2,168 8/21/2026
4.0.2220 17,708 8/18/2026
4.0.2219 5,508 8/18/2026
Loading failed

Update dependency Soenneker.Utils.MemoryStream to 4.0.1514 (#3044)