JamesConsulting 2.0.0

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

JamesConsulting

CI NuGet Downloads License: MIT Quality Gate Status Docs

A small, opinionated grab-bag of extension methods, helpers, and primitives shared across all James Consulting LLC libraries. Multi-targets netstandard2.0, netstandard2.1, net9.0, and net10.0 so it can drop into virtually any .NET project.


Install

dotnet add package JamesConsulting
<PackageReference Include="JamesConsulting" Version="2.0.*" />

Trusted Publishing: every JamesConsulting package on nuget.org is published via NuGet Trusted Publishing from this repo's ci.yml workflow (no long-lived API keys), and signed with Azure Trusted Signing under the James Consulting LLC identity.


What's included

Namespace Highlights
JamesConsulting StringExtensions, ByteArrayExtensions, EnumExtensions, ObjectExtensions (mask/redact, deep-clone, JSON helpers), Constants, MimeTypes, MethodTypeOptions
JamesConsulting.Cryptography Hashing/encoding helpers on top of string
JamesConsulting.Hosting HostExtensions, IHostInitializer / IHostInitializerAsync — run async one-shot startup work inside IHost before RunAsync()
JamesConsulting.IO StreamExtensions (read-to-end, copy with progress, etc.)
JamesConsulting.Net ConnectToSharedFolder — UNC/SMB credential impersonation. Connect() is Windows-only and throws PlatformNotSupportedException on macOS/Linux; Dispose() and the finalizer are safe no-ops on non-Windows.
JamesConsulting.Reflection TypeExtensions (default value resolution, async-method detection), MethodInfoExtensions
JamesConsulting.Security SecureStringExtensions, additional StringExtensions
JamesConsulting.Threading Async helpers on top of MethodInfo

All public APIs ship with XML documentation; downstream consumers get IntelliSense + SourceLink for step-into debugging.

📚 Full API reference: https://docs.jamesconsulting.biz/james-consulting-core/ (generated with DocFX from master).


What's new in 2.0

This is a breaking modernization. If you're upgrading from 1.x, read this list:

  • Dropped legacy target frameworks. Now multi-targets netstandard2.0, netstandard2.1, net9.0, net10.0. Removed: net5.0, net6.0, net7.0, net8.0, net462, netcoreapp3.1.
  • Removed Metalama / PostSharp dependencies. Argument validation that previously relied on Metalama contracts ([Required], [NotEmpty], [StrictlyPositive], etc.) is now provided by an internal Guard helper modelled on ArgumentNullException.ThrowIfNull. Exception types (ArgumentNullException / ArgumentException / ArgumentOutOfRangeException) and ParamName values are preserved against the v1.x contract. Exception messages and a few specific shapes changed — most notably MethodInfoExtensions.CreateTaskResult now throws a clear ArgumentException for non-Task<T> return types instead of bubbling a reflection-internal ArgumentException out of MakeGenericType. The library no longer pulls Metalama into your build graph.
  • Trimmed transitive surface. Single hosting reference (Microsoft.Extensions.Hosting.Abstractions 10.0.0).
  • macOS / Linux behavior. ConnectToSharedFolder.Connect() throws PlatformNotSupportedException on non-Windows OSes (it wraps Win32 WNetAddConnection2W). Dispose() and the finalizer are safe no-ops on those platforms instead of DllNotFoundException-crashing tests.
  • Centralized package metadata via src/Directory.Build.props (Authors, Company, Copyright, deterministic builds, embedded source, NBGV, SourceLink). No per-file copyright headers anymore.
  • Continuous deployment. Single ci.yml GitHub Actions workflow replaces the old split build/publish workflows and the legacy Azure DevOps pipeline.

Build & test

# from repo root
dotnet restore src/JamesConsulting.sln
dotnet build   src/JamesConsulting.sln --configuration Release
dotnet test    src/JamesConsulting.sln --configuration Release

Single TFM:

dotnet test src/JamesConsulting.Tests/JamesConsulting.Tests.csproj --framework net9.0

Filter to a single test:

dotnet test --filter "FullyQualifiedName~ObjectExtensionsTests.Mask"

Release process

Releases follow GitFlow + semver. The ci.yml workflow has three jobs:

Trigger Job Output
Any push / PR / dispatch build-test Build, test, Sonar, coverage, preview pack (*-ci.<run_number>). Runs on every push.
Push to release/** publish-rc Signs and publishes <MAJOR>.<MINOR>.<PATCH>-rc.<run_number> via NuGet Trusted Publishing.
Push tag v<MAJOR>.<MINOR>.<PATCH> publish-stable Verifies tag matches version.json and that the tagged commit is reachable from master, then signs and publishes. Also creates a GitHub Release.

Cutting a release:

# 1. cut release branch from develop
git switch develop && git pull
git switch -c release/2.0.0
git push -u origin release/2.0.0
# -> publish-rc fires automatically: 2.0.0-rc.<run>

# 2. when QA approves, merge release/2.0.0 -> master, then tag from master
git switch master && git pull
git tag v2.0.0
git push origin v2.0.0
# -> publish-stable fires: 2.0.0 stable + GitHub Release

# 3. back-merge master -> develop
git switch develop
git merge --no-ff master
git push

The major.minor.patch number lives in version.json. Bump it before opening the release branch.


Contributing

  1. Branch from develop (feature/<name> or bugfix/<name>).
  2. Tests first — this repo follows BDD/TDD with a 90% coverage target.
  3. Run dotnet build and dotnet test locally before pushing.
  4. Open a PR into develop. CI must be green and Sonar quality gate must pass.

Repo conventions live in AGENTS.md.


License

MIT © James Consulting LLC

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 is compatible.  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 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. 
.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 is compatible. 
.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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on JamesConsulting:

Package Downloads
AspectCentral.Abstractions

Package Description

AspectCentral.DispatchProxy

Aspect-oriented programming for Microsoft.Extensions.DependencyInjection built on System.Reflection.DispatchProxy. Wrap registered services with logging, profiling, or custom aspects without changing call sites; consumers configure their own logging sinks and OpenTelemetry exporters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 36 5/18/2026
2.0.0-rc.5 43 5/17/2026
2.0.0-beta 186 5/10/2024
1.0.2 1,050 8/13/2022
1.0.1 1,025 11/11/2021
1.0.0 993 10/14/2021
1.0.0-beta001 599 4/28/2020
1.0.0-alpha300000 1,233 9/27/2019
1.0.0-alpha2 2,004 8/11/2019
1.0.0-alpha1 615 8/9/2019
1.0.0-alpha 650 8/5/2019