Raisin.Core
2.0.0
dotnet add package Raisin.Core --version 2.0.0
NuGet\Install-Package Raisin.Core -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="Raisin.Core" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Raisin.Core" Version="2.0.0" />
<PackageReference Include="Raisin.Core" />
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 Raisin.Core --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Raisin.Core, 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 Raisin.Core@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=Raisin.Core&version=2.0.0
#tool nuget:?package=Raisin.Core&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Raisin.Core
Shared core utilities for .NET 8 desktop applications — file logging, atomic writes, credential protection, and process lifecycle management.
Features
- SafeFile — Atomic file I/O via temp-file-and-replace, preventing corruption on crash or power loss
- FileLogger — Rolling daily file logger that subscribes to Raisin.EventSystem events, with configurable retention and automatic cleanup
- DpapiStringProtector — Windows DPAPI-based encryption for storing credentials and secrets per-user (implements
IStringProtector) - AppPaths — Centralized application path management with support for portable and roaming (AppData) modes, including migration between the two
- ParentProcessWatcher — Monitor a parent process lifetime via
--parent-pidcommand-line argument and react when it exits - DoubleExtensions — Epsilon-based floating-point comparison (
ApproxEquals) for layout and rendering calculations
Installation
dotnet add package Raisin.Core
Quick start
Atomic file writes
SafeFile.WriteAllText("config.json", jsonString);
Event-driven file logging
var events = new EventSystem();
var logger = new FileLogger(events, "logs/myapp.log", retentionDays: 30);
events.Log(this, "Application started", LogTarget.File, LogSeverity.Info);
Credential protection (Windows)
IStringProtector protector = new DpapiStringProtector();
string encrypted = protector.Protect("my-api-key");
string decrypted = protector.Unprotect(encrypted);
Application paths
AppPaths.Configure("MyApp"); // sets up %AppData%/MyApp
AppPaths.SetPortable(true); // switch to app-local storage
string dataDir = AppPaths.DataDir; // current data directory
Dependencies
- Raisin.EventSystem — event bus for logging integration
- System.Security.Cryptography.ProtectedData — Windows DPAPI
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Raisin.EventSystem (>= 2.0.0)
- System.Security.Cryptography.ProtectedData (>= 10.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Raisin.Core:
| Package | Downloads |
|---|---|
|
Raisin.WPF.Base
Shared WPF base library — ViewModelBase, layout helpers, window placement, dark theme utilities |
GitHub repositories
This package is not used by any popular GitHub repositories.