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" />
                    
Directory.Packages.props
<PackageReference Include="Raisin.Core" />
                    
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 Raisin.Core --version 2.0.0
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=Raisin.Core&version=2.0.0
                    
Install as a Cake Tool

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-pid command-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

License

MIT

Product 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.

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.

Version Downloads Last Updated
2.0.0 47 6/8/2026
1.0.1 368 3/25/2026
1.0.0 357 3/25/2026