Curiosus.Tools 2.1.0

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

Curiosus.Tools

NuGet Downloads Coverage

Foundation library of the Curiosus packages: basic helpers, models and small services with few dependencies (logging and DI abstractions, Curiosus.Configuration, NodaTime, MemoryPools). Most other Curiosus packages build on it.

Installation

dotnet add package Curiosus.Tools

Usage

using Curiosus.Tools;
using Curiosus.Tools.AppInitializer;
using Curiosus.Tools.TempFiles;

// startup: DI registrations
services.AddLocalDateTimeService();                       // IDateTimeService over the local clock
services.AddTempFileServices(new TempFileOptions());      // ITempFileStreamFactory in ./.tmp
services.AddAppInitializer<WarmUpCacheInitializer>();     // IAppInitializer, run on start by Curiosus.Hosting

// unique 64-bit ids based on time; generatorId must differ between running processes
UniqueIdGenerator.Initialize(generatorId: 1);
long id = UniqueIdGenerator.Generate();
string publicId = id.ToPublicId();

// operation results
Response<Order> result = Response.Successful(order);
Response<Order> failed = Response.Failed<Order>(404, "Order not found");

// background work without losing exceptions
SendNotificationAsync(order).WithExceptionLogger(logger);

// hide secrets before logging JSON
var json = new SensitiveDataProtector("password").HideInJson(requestJson);

Main areas:

  • App lifecycle — IAppInitializer + AddAppInitializer, FireAndForget, ApplicationHelper, EnvironmentHelper.
  • Ids and hashing — UniqueIdGenerator, PublicId, UniqueKeyGenerator, XXHasher.
  • Date and time — IDateTimeService, DateTimePeriod, NullableDateTimePeriod, DateTimeHelper, TimeZoneHelper (NodaTime).
  • Models — Response/Response<T>, Error, Page, PaginationResponse.
  • Text — string/StringBuilder extensions, PhoneHelper, Transliteration, WebAddressValidator, SensitiveDataProtector, file size humanization.
  • Collections and threading — CircularBuffer, list/dictionary/hash set extensions, DynamicSemaphoreSlim.
  • Diagnostics — PerformanceManager.Measure and StuckCodeManager.Enter (call their Initialize(logger) first).
  • IO and HTTP — temp file streams, stream extensions, IHttpRequestParamsCalculator for size-based timeouts.

See the sample app for phone, transliteration and sensitive data examples.

See also

Product Compatible and additional computed target framework versions.
.NET 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. 
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 Curiosus.Tools:

Package Downloads
Curiosus.Localization

Classes for localizing applications in more efficient way than Microsfot's way.

Curiosus.SMS

Base classes for sendind SMS.

Curiosus.EMail

Base classes for working with EMails

Curiosus.Hosting

Hosting tools

Curiosus.RequestProcessing

Infrastructure for processing request/events from an queue.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 41 10/3/2026
2.0.0 180 9/28/2026