Skip to content

Repository files navigation

ByteForge Toolkit

A modular, enterprise-grade .NET library providing utilities for configuration management, database access, CLI parsing, security, data processing, file transfer, logging, and more.


Solution Overview

ByteForge.Toolkit.sln contains four C# projects targeting multiple .NET frameworks from a single codebase.

ByteForge.Toolkit.sln
├── Toolkit.Modern/ # ByteForge.Toolkit.Modern — core library (net48; net8.0; net9.0)
├── WinSCP/ # WinSCPnet — SFTP/FTP wrapper (net48-windows; net8.0-windows; net9.0-windows)
├── Toolkit.Modern.Tests/ # ByteForge.Toolkit.Modern.Tests — test suite (net48; net9.0)
└── TestBed/ # TestBed — scratch console app (net9.0-windows)

Project summaries

ProjectAssemblyFrameworksRole
Toolkit.ModernByteForge.Toolkit.Modernnet48, net8.0, net9.0Primary library — all modules live here
WinSCPWinSCPnetnet48-windows, net8.0-windows, net9.0-windows.NET wrapper for WinSCP (SFTP/FTP/FTPS/SCP)
Toolkit.Modern.TestsByteForge.Toolkit.Modern.Testsnet48, net9.0MSTest unit and integration tests
TestBedTestBednet9.0-windowsEphemeral console app for manual experimentation

Toolkit.Modern references WinSCPnet and also embeds WinSCP.exe as an EmbeddedResource for self-contained deployment.


Build Requirements

  • Visual Studio 2022 or 2026 (MSBuild is resolved automatically by the build script)
  • .NET SDK 9.0+ (for net8.0/net9.0 targets)
  • .NET Framework 4.8 developer pack (for the net48 target)
  • PowerShell (used internally by the build script)

Building the Solution

Use BuildSolution.bat from the repo root. It auto-detects the Visual Studio installation via vswhere, runs NuGet restore, and builds all projects.

:: Debug (default)
BuildSolution.bat
:: Release
BuildSolution.bat Release

The script:

  1. Cleans obj\ and bin\<cfg>\ directories before building.
  2. Searches for MSBuild via vswhere, then falls back through VS 2026/2022/2019/2017 and the .NET Framework SDK.
  3. Runs MSBuild restore followed by an AnyCPU build.
  4. Writes a build log to Logs\Build\ByteForge.Toolkit.log.

If you need a manual build (no script):

dotnet restore
dotnet build --configuration Debug

Running Tests

The test project targets both net48 and net9.0. Build the solution first, then:

# Run all tests (no rebuild)
dotnet test "Toolkit.Modern.Tests\ByteForge.Toolkit.Modern.Tests.csproj"--no-build
# Run with code coverage (OpenCover is included as a NuGet package)
cd Toolkit.Modern.Tests
packages\OpenCover.4.7.1221\tools\OpenCover.Console.exe`-target:"dotnet.exe"`-targetargs:"test ByteForge.Toolkit.Modern.Tests.csproj --no-build --configuration Debug"`-output:coverage.xml -register:user `-filter:"+[ByteForge.Toolkit*]*"# Generate HTML report
packages\ReportGenerator.5.4.18\tools\net47\ReportGenerator.exe`-reports:coverage.xml -targetdir:coverage-report -reporttypes:Html

Test categories:

CategoryLocation
CLIUnit\CLI\
ConfigurationUnit\Configuration\
Data (Audio, CSV, Database)Unit\Data\
DataStructuresUnit\DataStructures\
LoggingUnit\Logging\
MailUnit\Mail\
SecurityUnit\Security\
UtilsUnit\Utils\

ODBC tests (Access .mdb/.accdb) require the Microsoft Access ODBC driver and are separated from the default test run.


Solution Structure

.
├── Toolkit.Modern/ # Core library source (see Toolkit.Modern/readme.md)
│ ├── CommandLine/ # CLI parsing
│ ├── Configuration/ # INI configuration
│ ├── Core/ # Core utilities and WinSCP resource manager
│ ├── Data/ # CSV, database, audio, attributes
│ ├── DataStructures/ # BinarySearchTree, URL utilities
│ ├── Dependencies/ # Embedded WinSCP.exe
│ ├── Json/ # Delta serialization
│ ├── Logging/ # Logging system
│ ├── Mail/ # Email/attachment processing
│ ├── Net/ # File transfer client
│ ├── Properties/ # AssemblyInfo.cs
│ ├── Security/ # AES encryption
│ ├── Utilities/ # General-purpose helpers
│ └── ByteForge.Toolkit.Modern.csproj
├── WinSCP/ # WinSCPnet wrapper library
│ └── WinSCPnet.csproj
├── Toolkit.Modern.Tests/ # Test suite
│ ├── Unit/ # Unit tests organised by module
│ ├── Helpers/ # Shared test helpers
│ ├── Models/ # Test data models
│ ├── TestData/ # Access databases, large dummy files
│ └── ByteForge.Toolkit.Modern.Tests.csproj
├── TestBed/ # Manual experimentation console app
│ └── TestBed.csproj
├── .github/
│ ├── scripts/ # bootstrap-test-sql.ps1
│ └── workflows/ # ci.yml
├── BuildSolution.bat # Primary build script
├── ByteForge.Tasks.targets # Custom MSBuild targets (bidirectional sync, versioning)
└── ByteForge.Toolkit.sln

Custom Build System — ByteForge.Tasks.targets

ByteForge.Tasks.targets is an optional MSBuild import that adds enterprise-grade build automation. It is only active when a CentralLocationPath property is set and the targets file is reachable from the project directory.

Key capabilities:

PhaseTargetDescription
1 — Pre-buildSyncFromCentralCopies files from a central shared location into the project (newer-wins).
2 — Post-buildSyncToCentralPushes changed project files back to the central location.
3 — CleanupSafeCleanupCentralRemoves obsolete files from the central location that are no longer in the project.
4 — VersioningUpdateSmartVersionIncrements Minor for new files, Patch for modified files, and writes the version to version.txt and AssemblyInfo.cs.
5 — HousekeepingForceCleanupFilesDeletes leftover artefacts from the previous ROBOCOPY-based build system.

The bidirectional sync uses a custom inline Roslyn task (BidirectionalSyncTask) and only copies a file when the source timestamp is newer than the target. The versioning format is Major.Minor.Patch.MMdd.


Dependencies

Toolkit.Modern

PackageVersionPurpose
Costura.Fody / Fody6.0.0 / 6.9.3Embeds dependencies into the output assembly
Microsoft.Extensions.Configuration + extensions9.0.10INI configuration provider
Newtonsoft.Json13.0.4JSON serialization
RestSharp112.1.0HTTP client
System.CommandLine2.0.0-beta4CLI parsing (net8.0/net9.0 only)
System.CommandLine.NamingConventionBinder2.0.0-beta4CLI option binding
Microsoft.Data.SqlClient6.0.1SQL Server connectivity
System.Data.Odbc9.0.10ODBC connectivity
System.Text.Json9.0.10High-performance JSON
Various BCL back-portsSystem.Memory, System.Buffers, System.IO.Pipelines, System.ValueTuple, etc.

WinSCPnet

PackageVersionPurpose
System.Diagnostics.PerformanceCounter9.0.10Performance monitoring
System.Threading.AccessControl9.0.10Thread synchronisation primitives

Toolkit.Modern.Tests

PackageVersionPurpose
MSTest4.0.1Test framework
Microsoft.NET.Test.Sdk18.0.0Test runner
AwesomeAssertions9.3.0Fluent assertion library
OpenCover4.7.1221Code coverage instrumentation
ReportGenerator5.4.18HTML coverage reports
coverlet.collector6.0.4Alternative coverage collector

Build Artefacts

ConfigurationOutput location
DebugToolkit.Modern\bin\Debug\net48\, \net8.0\, \net9.0\
ReleaseToolkit.Modern\bin\Release\net48\, \net8.0\, \net9.0\
API docsToolkit.Modern\bin\ByteForge.Toolkit.Modern.xml
Build logsLogs\Build\ByteForge.Toolkit.log
Test resultsToolkit.Modern.Tests\TestResults\

Module Documentation

Modulereadme
Core libraryToolkit.Modern/readme.md
WinSCP wrapperWinSCP/readme.md
CommandLineToolkit.Modern/CommandLine/readme.md
ConfigurationToolkit.Modern/Configuration/readme.md
CoreToolkit.Modern/Core/readme.md
DataToolkit.Modern/Data/readme.md
DataStructuresToolkit.Modern/DataStructures/readme.md
JsonToolkit.Modern/Json/readme.md
LoggingToolkit.Modern/Logging/readme.md
MailToolkit.Modern/Mail/readme.md
NetToolkit.Modern/Net/readme.md
SecurityToolkit.Modern/Security/readme.md
UtilitiesToolkit.Modern/Utilities/readme.md

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages