Aicrosoft.Extensions
8.0.0-beta.260130.2
dotnet add package Aicrosoft.Extensions --version 8.0.0-beta.260130.2
NuGet\Install-Package Aicrosoft.Extensions -Version 8.0.0-beta.260130.2
<PackageReference Include="Aicrosoft.Extensions" Version="8.0.0-beta.260130.2" />
<PackageVersion Include="Aicrosoft.Extensions" Version="8.0.0-beta.260130.2" />
<PackageReference Include="Aicrosoft.Extensions" />
paket add Aicrosoft.Extensions --version 8.0.0-beta.260130.2
#r "nuget: Aicrosoft.Extensions, 8.0.0-beta.260130.2"
#:package Aicrosoft.Extensions@8.0.0-beta.260130.2
#addin nuget:?package=Aicrosoft.Extensions&version=8.0.0-beta.260130.2&prerelease
#tool nuget:?package=Aicrosoft.Extensions&version=8.0.0-beta.260130.2&prerelease
Aicrosoft.Extensions
Aicrosoft.Extensions is a comprehensive utility library that provides a wide range of extension methods and helper classes to simplify common tasks in .NET development. It aims to reduce boilerplate code and improve developer productivity by extending the capabilities of the standard .NET system types.
Design Goals
- Reduce Redundant Code: Centrally implement frequently used functions like string manipulation, IO operations, and JSON transformation to avoid reinventing the wheel in every project.
- Enhance Native Types: Inject practical methods into native types such as
string,DateTime,Enum, andList, making code cleaner and more readable. - Fluent Parameter Validation: Provide a
Checkclass for elegant defensive programming through fluent argument validation. - Broad Compatibility: Support .NET Standard 2.0, .NET Framework 4.6.2, and .NET 8.0, ensuring seamless usage in both legacy systems and modern applications.
- Built-in Utilities: Include lightweight versions of caching (
ICache), console progress bars, file locking mechanisms, and other tools commonly needed during development.
Core Features
1. System Type Extensions (System)
- String:
Truncate,ToCamelCase,ToMd5,ToEnum,Left/Rightmanipulation, and more. - Collections:
IsNullOrEmptychecks,ForEachiterators, and dictionary merging. - DateTime: Human-readable time displays, customized formatting, and period calculations.
- Object:
ToJson(easy serialization),As<T>(safe casting), and property copying.
2. Parameter Validation (Check)
A concise API for validating method arguments:
Check.NotNull(obj): Validates that an object is not null.Check.NotNullOrEmpty(str): Validates that a string is neither null nor empty.Check.Length(str, max, min): Validates that a string's length is within a specified range.
3. Data Processing (System.Text, System.Xml)
- JSON Enhancements:
PolymorphicValueConverterfor handling polymorphic types, andToRemoveJsonCommentsfor cleaning JSON strings. - XML Utilities: Simplified methods for XML parsing and transformation.
4. IO & Diagnostics (System.IO, System.Diagnostics)
- File System: Recursive directory deletion, safe file reading, and path normalization.
- Diagnostics: Simplified output methods like
ToTrace()andToDebug()for direct logging to debug terminals. - Console Interaction: Built-in
ProgressBarfor displaying task progress in the command line.
Usage Examples
String Manipulation
using System;
// Truncate with an ellipsis
string title = "This is a very long article title that needs to be shortened";
string display = title.TruncateWithPostfix(20, "..."); // "This is a very lon..."
// Case conversion
string kebab = "UserRoleMember".ToKebabCase(); // "user-role-member"
Robust Parameter Checking
public void UpdateEmail(string email)
{
// Throws an exception with the parameter name if email is null or whitespace
Check.NotNullOrWhiteSpace(email, nameof(email));
// Logic here...
}
Console Progress Bar
using (var progress = new ProgressBar())
{
for (int i = 0; i <= 100; i++)
{
progress.Report((double)i / 100);
// Execute task...
}
}
Links
| Product | Versions 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 is compatible. 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 is compatible. 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. |
-
.NETFramework 4.6.2
- System.Memory (>= 4.6.3)
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
-
net8.0
- System.Memory (>= 4.6.3)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Aicrosoft.Extensions:
| Package | Downloads |
|---|---|
|
Aicrosoft.Extensions.Hosting
- Implemented plugin framework and several foundational service base classes; - Added logger scope extensions and enhanced dependency injection utilities with extended DI features; |
|
|
Aicrosoft.Extensions.AspectCore
Some extensions and implementations related to Aspect-Oriented Programming [AOP]. |
|
|
Aicrosoft.Extensions.Mvc
Extensions for dotnet Mvc Web. |
|
|
Aicrosoft.Scheduling
> Keywords: `jobsFactory`, `jobs`, `task`, `job`, `routine`, `schedule`, `setup`, `startup`, `interval`, `cronexpression`, `jobagent` [JobsFactory](https://www.nuget.org/packages/Aicrosoft.Scheduling/) is a task scheduling framework that supports multiple types of jobs(tasks) and is easily extensible. It is written in [dotnet8](https://dotnet.microsoft.com/en-us/). An implementation example of the JobsFactory framework: [JobAgent](https://github.com/neatFactory/JobAgent) |
|
|
Aicrosoft.Extensions.Azure
Extensions related to Azure and azure deployment. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.0-beta.260130.2 | 75 | 1/30/2026 |
| 8.0.0-beta.260127.1 | 77 | 1/27/2026 |
| 8.0.0-beta.251110.1 | 368 | 11/10/2025 |