Sharingan 1.0.4
dotnet add package Sharingan --version 1.0.4
NuGet\Install-Package Sharingan -Version 1.0.4
<PackageReference Include="Sharingan" Version="1.0.4" />
<PackageVersion Include="Sharingan" Version="1.0.4" />
<PackageReference Include="Sharingan" />
paket add Sharingan --version 1.0.4
#r "nuget: Sharingan, 1.0.4"
#:package Sharingan@1.0.4
#addin nuget:?package=Sharingan&version=1.0.4
#tool nuget:?package=Sharingan&version=1.0.4
Sharingan
Cross-Platform Local Settings Library for .NET
A robust, multi-process-safe, async-first settings library for managing application, user, and device settings locally.
✨ Features
- 🌍 Cross-Platform — Works on Windows, Linux, macOS, Android, and iOS
- 🔒 Multi-Process Safe — File locking and atomic writes prevent data corruption
- ⚡ Async-First — Full async/await support with CancellationToken
- 🔌 11 Pluggable Providers — JSON, Registry, INI, YAML, XML, TOML, SQLite, and more
- 🏗️ Composite Configuration — Chain multiple providers with priority-based resolution
- 🔐 Encryption Support — AES-256-GCM and DPAPI for sensitive settings
- 📦 Lightweight — Minimal dependencies, optimized for performance
- 🎯 Multi-Target — Supports .NET Framework 4.8+, .NET Standard 2.0+, and .NET 7-10
- 🔔 Change Notifications — Event-driven updates when settings change
- 💪 Strongly-Typed — Full generic support with type-safe access
- 🔗 DI Integration — Microsoft.Extensions.DependencyInjection support
- 🌐 Configuration Bridge — Works with Microsoft.Extensions.Configuration
📦 Installation
Core Package
dotnet add package Sharingan
Provider Packages
# Windows Registry support
dotnet add package Sharingan.Providers.Registry
# INI file support
dotnet add package Sharingan.Providers.Ini
# YAML file support
dotnet add package Sharingan.Providers.Yaml
# XML file support
dotnet add package Sharingan.Providers.Xml
# TOML file support
dotnet add package Sharingan.Providers.Toml
# SQLite database support
dotnet add package Sharingan.Providers.SQLite
# Encryption support
dotnet add package Sharingan.Providers.Encrypted
Extension Packages
# Dependency Injection integration
dotnet add package Sharingan.Extensions.DependencyInjection
# Microsoft.Extensions.Configuration bridge
dotnet add package Sharingan.Extensions.Configuration
🚀 Quick Start
Basic Usage
using Sharingan;
// Store settings
Settings.Default.Set("app.theme", "Dark");
Settings.Default.Set("app.fontSize", 14);
Settings.Default.Set("app.autoSave", true);
// Retrieve settings with type-safe access
string theme = Settings.Default.GetString("app.theme");
int fontSize = Settings.Default.GetInt("app.fontSize");
bool autoSave = Settings.Default.GetBool("app.autoSave");
// Or use generic Get<T>
var config = Settings.Default.Get<AppConfig>("app.config", new AppConfig());
Using the Builder Pattern
using Sharingan;
using Sharingan.Providers;
ISettingsStore settings = new SharinganBuilder()
.WithApplicationName("MyApp")
.WithOrganizationName("MyCompany")
.UseEnvironmentVariables("MYAPP_", priority: 100) // Highest priority
.UseJsonFile("settings.json", SettingsScope.User, priority: 50)
.UseInMemory(priority: 10) // Fallback
.Build();
// Environment variables override JSON file settings
settings.Set("database.host", "localhost");
string host = settings.GetString("database.host");
Dependency Injection
using Sharingan.Extensions.DependencyInjection;
services.AddSharingan(builder => builder
.WithApplicationName("MyApp")
.UseJsonFile("settings.json")
);
// Inject anywhere
public class MyService(ISettingsStore settings)
{
public string GetTheme() => settings.GetString("theme", "Light");
}
🔧 Providers
| Provider | Package | Description | Cross-Platform |
|---|---|---|---|
| JSON | Sharingan |
Default file-based storage | ✅ |
| InMemory | Sharingan |
Session-scoped, non-persistent | ✅ |
| Environment | Sharingan |
Read-only environment variables | ✅ |
| Composite | Sharingan |
Chain multiple providers | ✅ |
| Registry | .Providers.Registry |
Windows Registry storage | ❌ Windows |
| INI | .Providers.Ini |
INI file format | ✅ |
| YAML | .Providers.Yaml |
YAML file format | ✅ |
| XML | .Providers.Xml |
XML file format | ✅ |
| TOML | .Providers.Toml |
TOML file format | ✅ |
| SQLite | .Providers.SQLite |
Database storage | ✅ |
| Encrypted | .Providers.Encrypted |
Encryption wrapper | ✅ |
🎯 Target Frameworks
| Framework | Supported |
|---|---|
| .NET Framework 4.8 | ✅ |
| .NET Framework 4.8.1 | ✅ |
| .NET Standard 2.0 | ✅ |
| .NET Standard 2.1 | ✅ |
| .NET 7.0 | ✅ |
| .NET 8.0 | ✅ |
| .NET 9.0 | ✅ |
| .NET 10.0 | ✅ |
🌐 Supported Platforms
| Platform | Supported | Notes |
|---|---|---|
| Windows | ✅ | Full support including Registry provider |
| Linux | ✅ | Full support via file-based providers |
| macOS | ✅ | Full support via file-based providers |
| Android | ✅ | Via .NET Standard / MAUI, uses internal app storage |
| iOS | ✅ | Via .NET Standard / MAUI, uses app sandbox Library folder |
📄 License
This project is licensed under the MIT License.
🔗 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 is compatible. 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 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 is compatible. net481 is compatible. |
| 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.8
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.1)
- Sharingan.Abstractions (>= 1.0.4)
- System.Text.Json (>= 10.0.1)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETFramework 4.8.1
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.1)
- Sharingan.Abstractions (>= 1.0.4)
- System.Text.Json (>= 10.0.1)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.1)
- Sharingan.Abstractions (>= 1.0.4)
- System.Text.Json (>= 10.0.1)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.1
- Sharingan.Abstractions (>= 1.0.4)
- System.Text.Json (>= 10.0.1)
-
net10.0
- Sharingan.Abstractions (>= 1.0.4)
-
net7.0
- Sharingan.Abstractions (>= 1.0.4)
-
net8.0
- Sharingan.Abstractions (>= 1.0.4)
-
net9.0
- Sharingan.Abstractions (>= 1.0.4)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Sharingan:
| Package | Downloads |
|---|---|
|
Sharingan.Extensions.Configuration
Provides integration between Sharingan and Microsoft.Extensions.Configuration. Allows using Sharingan settings providers as configuration sources in ASP.NET Core and .NET applications. Supports binding configuration sections to strongly-typed objects and automatic reload on settings changes. |
|
|
Sharingan.Providers.Ini
Stores application settings in standard INI file format. Supports sections, key-value pairs, comments, and multi-line values. Provides a familiar configuration format that is human-readable and easily editable with any text editor. Includes multi-process safety with file locking. |
|
|
Sharingan.Providers.Yaml
Stores application settings in YAML (YAML Ain't Markup Language) format. Provides a clean, readable configuration format with support for complex nested structures, lists, and multi-line strings. Popular choice for cloud-native and DevOps applications. Includes multi-process safety with file locking. |
|
|
Sharingan.Providers.Encrypted
Provides transparent encryption for any Sharingan settings provider. Supports multiple encryption strategies including DPAPI (Windows Data Protection API) for machine/user-scoped encryption and AES-256-GCM for cross-platform symmetric encryption. Ideal for storing sensitive settings like API keys, connection strings, and user credentials. |
|
|
Sharingan.Providers.Toml
Stores application settings in TOML (Tom's Obvious Minimal Language) format. Provides a clean, human-friendly configuration format with support for tables, arrays, dates, and nested structures. Popular choice for modern applications and developer tools. Includes multi-process safety with file locking. |
GitHub repositories
This package is not used by any popular GitHub repositories.