Black.Beard.Helpers 2.0.59

dotnet add package Black.Beard.Helpers --version 2.0.59
                    
NuGet\Install-Package Black.Beard.Helpers -Version 2.0.59
                    
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="Black.Beard.Helpers" Version="2.0.59" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Black.Beard.Helpers" Version="2.0.59" />
                    
Directory.Packages.props
<PackageReference Include="Black.Beard.Helpers" />
                    
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 Black.Beard.Helpers --version 2.0.59
                    
#r "nuget: Black.Beard.Helpers, 2.0.59"
                    
#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.
#addin nuget:?package=Black.Beard.Helpers&version=2.0.59
                    
Install Black.Beard.Helpers as a Cake Addin
#tool nuget:?package=Black.Beard.Helpers&version=2.0.59
                    
Install Black.Beard.Helpers as a Cake Tool

Black.Beard.Helpers

NuGet

Introduction

Black.Beard.Helpers is a powerful .NET utility library that streamlines file system operations, content manipulation, URI handling, and network tasks. It provides a comprehensive set of extension methods and helper classes designed to reduce boilerplate code and improve developer productivity when working with file systems and content resources.

Key benefits:

  • Intuitive API design with fluent interfaces and method chaining for improved code readability
  • Cross-platform compatibility ensuring consistent behavior across Windows, macOS, and Linux
  • Robust error handling with clear exception patterns and informative messages
  • Performance optimizations for common content operations
  • Extensive content encoding support with automatic detection and conversion

Installation

Prerequisites

  • .NET Standard 2.0+
  • .NET Core 2.0+ / .NET 5.0+
  • .NET Framework 4.6.1+

Package Manager

Install-Package Black.Beard.Helpers

.NET CLI

dotnet add package Black.Beard.Helpers

Package Reference

<PackageReference Include="Black.Beard.Helpers" Version="1.0.0" />

Features

Generic singleton

use a generic method for store datas in a singleton

using Bb;

// global
StaticContainer.Set(new MyClass())
var value = StaticContainer.Get<MyClass>();

// For the current thread
StaticThreadContainer.Set(new MyClass())
var value = StaticThreadContainer.Get<MyClass>();

File and Directory Management

Easily work with files and directories using intuitive extension methods.

using Bb;

// Create directory if it doesn't exist
DirectoryInfo dir = @"C:\temp\projects".CreateFolderIfNotExists();

// Write content to files with encoding options
FileInfo log = new FileInfo("application.log");
log.WriteFile("Application started", append: true);

// Copy files between directories
var source = new FileInfo("document.pdf");
bool success = source.CopyToDirectory(@"C:\backup", overwrite: false);

Path Operations

Handle file paths consistently across platforms.

using Bb;

// Convert between string paths and FileInfo/DirectoryInfo
FileInfo file = @"C:\config\settings.json".AsFile();
DirectoryInfo dir = @"C:\logs".AsDirectory();

// Platform-aware path comparison
bool areEqual = @"C:\Program Files".IsPathEquals(@"c:\program files");
// true on Windows, false on Linux

// Safely combine path segments
string path = @"C:\projects".Combine("src", "main", "resources");
// "C:\projects\src\main\resources"

using Bb;

// Create URIs with path segments
Uri api = "https://api.example.com".ToUri("v2", "users");
// https://api.example.com/v2/users

// Find available ports and create URIs
int port = 8000;
Uri serviceUri = "http".ToUri("localhost", ref port, "api");
// port will be updated to an available port number

// Combine URL parts safely
string url = UriExtensions.Combine(
    "https://example.com", 
    "search", 
    "?q=dotnet", 
    "&page=1"
);
// https://example.com/search?q=dotnet&page=1

HTTP and Network Helpers

Simplify HTTP operations and network resource handling.

using Bb;
using System.IO;

// Download content from a URL to a file
Uri source = new Uri("https://example.com/files/document.pdf");
FileInfo target = new FileInfo("document.pdf");
source.Download(target);

// Find available network ports
int port = HttpHelper.GetAvailablePort(8080);
Console.WriteLine($"Port {port} is available for use");

Platform Support

Black.Beard.Helpers is designed to work seamlessly across different operating systems:

  • Automatic platform detection for path comparison and formatting
  • Path normalization for consistent handling of forward/backward slashes
  • Case sensitivity awareness that adapts to the operating system
  • Encoding detection and conversion that works reliably across platforms

License

This library is licensed under the MIT License - see the LICENSE file for details. This library is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Black.Beard.Helpers:

Package Downloads
Black.Beard.Roslyn

Helper for compile Csharp at runtime

Black.Beard.Web.Server

Provide a service base for just concentrate your services

Black.Beard.Policies

The Black.Beard.Policies library is designed to help developers manage and evaluate authorization policies in .NET applications. It provides a flexible syntax for defining rules based on user claims, roles, and other contextual data. With this library, you can easily create, organize, and enforce complex access control policies, making it suitable for scenarios where fine-grained security and dynamic rule evaluation are required. It also integrates with web applications and supports external identity providers like Keycloak for authentication testing.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.59 246 4/4/2025
2.0.58 160 4/3/2025
2.0.57 165 4/3/2025
2.0.56 150 4/2/2025
2.0.55 154 4/2/2025
2.0.54 226 3/31/2025
2.0.53 135 3/27/2025
2.0.51 142 3/17/2025
2.0.50 148 3/13/2025
2.0.49 244 1/12/2025
2.0.47 187 12/7/2024
2.0.46 99 11/29/2024
2.0.45 87 11/27/2024
2.0.44 113 11/27/2024
2.0.43 104 11/24/2024
2.0.42 118 11/24/2024
2.0.41 158 11/19/2024
2.0.40 232 10/28/2024
2.0.39 458 9/23/2024
2.0.38 134 5/18/2024
2.0.37 259 5/2/2024
2.0.36 137 4/25/2024
2.0.35 157 4/24/2024
2.0.34 121 4/24/2024
2.0.33 129 4/24/2024
2.0.32 471 3/24/2024
2.0.31 199 3/19/2024
2.0.30 1,032 3/13/2024
2.0.29 154 3/13/2024