DevelApp.RuntimePluggableClassFactory.Interface
2.0.10
See the version list below for details.
dotnet add package DevelApp.RuntimePluggableClassFactory.Interface --version 2.0.10
NuGet\Install-Package DevelApp.RuntimePluggableClassFactory.Interface -Version 2.0.10
<PackageReference Include="DevelApp.RuntimePluggableClassFactory.Interface" Version="2.0.10" />
<PackageVersion Include="DevelApp.RuntimePluggableClassFactory.Interface" Version="2.0.10" />
<PackageReference Include="DevelApp.RuntimePluggableClassFactory.Interface" />
paket add DevelApp.RuntimePluggableClassFactory.Interface --version 2.0.10
#r "nuget: DevelApp.RuntimePluggableClassFactory.Interface, 2.0.10"
#:package DevelApp.RuntimePluggableClassFactory.Interface@2.0.10
#addin nuget:?package=DevelApp.RuntimePluggableClassFactory.Interface&version=2.0.10
#tool nuget:?package=DevelApp.RuntimePluggableClassFactory.Interface&version=2.0.10
RuntimePluggableClassFactory
A comprehensive .NET library for dynamic plugin loading, execution, and management with enhanced stability, type safety, and security features.
🚀 TDS Implementation Complete
This project has been enhanced with a complete Technical Design Specification (TDS) implementation featuring:
- ✅ Dynamic Plugin Loading/Unloading with AssemblyLoadContext
- ✅ Enhanced Stability with comprehensive error handling
- ✅ Type Safety with strongly-typed plugin interfaces
- ✅ Security Hardening with multi-level validation
- ✅ Comprehensive Testing with 48 tests across 7 categories
See TDS_IMPLEMENTATION.md for complete implementation details.
Features
Core Capabilities
- Dynamic plugin discovery and loading from directories
- Runtime plugin unloading with proper memory cleanup
- Version-aware plugin management
- Thread-safe concurrent plugin execution
- Comprehensive error handling and recovery
Type Safety
- Generic plugin interfaces:
ITypedPluginClass<TInput, TOutput> - Strongly-typed DTOs for plugin communication
- Execution context with logging and cancellation support
- Type-safe plugin discovery and execution
Security
- Multi-level security validation (assembly, type, method)
- Configurable security policies (Default, Strict, Permissive)
- Digital signature verification
- Trusted path validation
- Prohibited namespace and type detection
Performance
- High-throughput concurrent execution (>100 exec/sec)
- Fast plugin instantiation (<100ms average)
- Efficient memory management with unloading
- Performance monitoring and validation
Quick Start
Basic Usage
using DevelApp.RuntimePluggableClassFactory;
using DevelApp.RuntimePluggableClassFactory.FilePlugin;
using DevelApp.RuntimePluggableClassFactory.Security;
// Create plugin loader with security validation
var securityValidator = new DefaultPluginSecurityValidator(PluginSecuritySettings.CreateDefault());
var pluginLoader = new FilePluginLoader<IMyPluginInterface>(pluginDirectory, securityValidator);
var pluginFactory = new PluginClassFactory<IMyPluginInterface>(pluginLoader);
// Load and execute plugins
await pluginFactory.RefreshPluginsAsync();
var plugin = pluginFactory.GetInstance("MyModule", "MyPlugin");
var result = plugin.Execute("input data");
// Cleanup
pluginLoader.UnloadAllPlugins();
Type-Safe Usage
// Define strongly-typed input/output
public class MyInput { public string Data { get; set; } }
public class MyOutput { public string Result { get; set; } }
// Create typed plugin factory
var typedFactory = new TypedPluginClassFactory<IMyTypedPlugin, MyInput, MyOutput>(pluginLoader);
// Execute with type safety
var input = new MyInput { Data = "test" };
var result = typedFactory.ExecutePlugin("MyModule", "MyPlugin", input);
if (result.Success)
{
Console.WriteLine($"Result: {result.Data.Result}");
}
Plugin Development
Basic Plugin Interface
public interface IMyPluginInterface : IPluginClass
{
// Custom execution method for this specific interface
string ProcessData(string input);
}
public class MyPlugin : IMyPluginInterface
{
// Implement IPluginClass properties
public IdentifierString Name => "MyPlugin";
public NamespaceString Module => "MyModule";
public string Description => "Example plugin implementation";
public SemanticVersionNumber Version => new SemanticVersionNumber(1, 0, 0);
public string ProcessData(string input)
{
return $"Processed: {input}";
}
}
Type-Safe Plugin Interface
public interface IMyTypedPlugin : ITypedPluginClass<MyInput, MyOutput>
{
// Inherits both IPluginClass and ITypedPluginClass methods
}
public class MyTypedPlugin : IMyTypedPlugin
{
// Implement IPluginClass properties
public IdentifierString Name => "MyTypedPlugin";
public NamespaceString Module => "MyModule";
public string Description => "Example typed plugin implementation";
public SemanticVersionNumber Version => new SemanticVersionNumber(1, 0, 0);
public PluginExecutionResult<MyOutput> Execute(IPluginExecutionContext context, MyInput input)
{
context?.Logger?.LogInformation($"Processing: {input.Data}");
return PluginExecutionResult<MyOutput>.CreateSuccess(new MyOutput
{
Result = $"Processed: {input.Data}"
});
}
}
Testing
The project includes comprehensive testing with 48 tests across 7 categories:
# Run all tests
dotnet test
# Expected: 48 tests passing
Test Categories
- Unit Tests (4) - Core functionality
- Stability Tests (5) - Error handling
- Unloading Tests (2) - Dynamic unloading
- Typed Plugin Tests (8) - Type safety
- Security Tests (13) - Security validation
- Integration Tests (8) - End-to-end workflows
- Performance Tests (8) - Performance benchmarks
Security
Security Policies
// Default security (balanced)
var defaultSettings = PluginSecuritySettings.CreateDefault();
// Strict security (high security)
var strictSettings = PluginSecuritySettings.CreateStrict();
// Permissive security (minimal restrictions)
var permissiveSettings = PluginSecuritySettings.CreatePermissive();
var validator = new DefaultPluginSecurityValidator(strictSettings);
Security Features
- Assembly size limits and digital signature verification
- Prohibited namespace and type detection
- Dangerous method pattern analysis
- Trusted path validation
- Risk level assessment
Performance Benchmarks
All performance targets are validated by automated tests:
| Metric | Target | Status |
|---|---|---|
| Plugin Discovery | < 5 seconds | ✅ Validated |
| Plugin Instantiation | < 100ms avg | ✅ Validated |
| Plugin Execution | < 10ms avg | ✅ Validated |
| Concurrent Throughput | > 100 exec/sec | ✅ Validated |
| Security Validation | < 500ms avg | ✅ Validated |
| Memory Growth | < 50MB under load | ✅ Validated |
Architecture
Core Components
- PluginLoadContext: Collectible AssemblyLoadContext for proper unloading
- FilePluginLoader: File-based plugin discovery and loading
- PluginClassFactory: Core plugin factory with error handling
- TypedPluginClassFactory: Type-safe plugin execution
- PluginExecutionSandbox: Isolated execution environment
- DefaultPluginSecurityValidator: Comprehensive security validation
Key Interfaces
IPluginClass: Basic plugin interfaceITypedPluginClass<TInput, TOutput>: Type-safe plugin interfaceIPluginLoader<T>: Plugin loading interfaceIPluginSecurityValidator: Security validation interface
Documentation
- TDS Implementation Details - Complete TDS implementation documentation
- Testing Strategy - Comprehensive testing approach
Requirements
- .NET 8.0 or later
- xUnit (for testing)
- Compatible with Windows, Linux, and macOS
Installation
# Clone repository
git clone https://github.com/DevelApp-ai/RuntimePluggableClassFactory.git
# Build solution
dotnet build RuntimePluggableClassFactory.sln
# Run tests
dotnet test
Why Use RuntimePluggableClassFactory
Original Use Cases (Still Supported)
- Websites/APIs without persisted session state: Avoid session loss during dependency injection reloads
- Separating frequently modified extensions: Enable runtime loading and replacement without application restart
- A/B testing for services: Load different plugin versions for testing
- Fault isolation: Plugin errors don't crash the entire application
- Easier testing: Test extensions separately from other concerns
Enhanced TDS Capabilities
- Dynamic Plugin Management: Load and unload plugins without application restart
- Type Safety: Strongly-typed plugin interfaces eliminate runtime type errors
- Security Hardening: Multi-level validation prevents malicious plugin execution
- Performance Optimization: High-throughput concurrent execution with memory management
- Comprehensive Testing: 48 automated tests ensure reliability and performance
Contributing
- Fork the repository
- Create a feature branch
- Implement changes with tests
- Ensure all 48 tests pass
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For questions, issues, or support:
- Review the comprehensive test suite (48 tests)
- Check the TDS Implementation Guide
- Examine the Testing Strategy
- Create an issue on GitHub
TDS Implementation Status: ✅ Complete - All requirements implemented and validated
| 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. |
-
net8.0
- DevelApp.Utility (>= 1.0.7)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DevelApp.RuntimePluggableClassFactory.Interface:
| Package | Downloads |
|---|---|
|
DevelApp.Workflow.Core
Interfaces for DevelApp.Workflow which is an oppinionated Workflow for Akka.Net making it easy to handle workflows |
|
|
DevelApp.RuntimePluggableClassFactory
A comprehensive .NET library for dynamic plugin loading, execution, and management with enhanced stability, type safety, and security features. Supports dynamic plugin loading/unloading with AssemblyLoadContext, type-safe plugin interfaces, multi-level security validation, and comprehensive error handling. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 90 | 11/4/2025 |
| 2.0.12 | 90 | 11/3/2025 |
| 2.0.11 | 86 | 11/2/2025 |
| 2.0.10 | 199 | 10/29/2025 |
| 2.0.9 | 185 | 10/27/2025 |
| 2.0.8 | 182 | 10/27/2025 |
| 2.0.7 | 186 | 10/26/2025 |
| 2.0.6 | 174 | 10/26/2025 |
| 2.0.5 | 160 | 10/26/2025 |
| 2.0.4 | 170 | 10/26/2025 |
| 2.0.3 | 173 | 10/26/2025 |
| 2.0.2 | 173 | 10/26/2025 |
| 2.0.1 | 3,957 | 8/20/2025 |
| 2.0.1-ci0028 | 176 | 8/20/2025 |
| 2.0.1-ci0006 | 177 | 8/20/2025 |
| 2.0.0 | 156 | 8/17/2025 |
| 1.0.7 | 1,019 | 11/21/2021 |
| 1.0.6 | 670 | 12/23/2020 |
| 1.0.4 | 1,707 | 12/22/2020 |
| 1.0.2 | 3,286 | 11/8/2020 |
| 1.0.1 | 655 | 11/8/2020 |
| 1.0.0 | 724 | 11/8/2020 |
TDS Implementation Complete:
- Added ITypedPluginClass<TInput, TOutput> for type-safe plugin development
- IPluginExecutionContext with logging, cancellation, and properties support
- PluginExecutionResult<T> for strongly-typed execution results
- Backward compatible with existing IPluginClass implementations
- Enhanced plugin metadata and versioning support