Installation
Install AlmightyShogun.RemoteCommands in the application that should listen for remote command payloads and dispatch them to typed command handlers. The package targets net10.0 and uses dependency injection for the listener and discovered commands.
sh
dotnet add package AlmightyShogun.RemoteCommandsDependencies
Microsoft.Extensions.DependencyInjection.Abstractions10.0.8— provides service registration APIs.AlmightyShogun.Loggingproject reference — provides logging behavior used by the listener.AlmightyShogun.Utilsproject reference — provides assembly scanning and inherited-type registration helpers.
Startup Registration
Register the listener services, then scan the assemblies that contain remote command classes. Resolve IRemoteCommandHandler from dependency injection when the application is ready to start or stop the listener.
WARNING
Requires a RemoteServer section in application configuration, usually from appsettings.json.
csharp
using AlmightyShogun.RemoteCommands;
builder.Services
.AddRemoteCommands(builder.Configuration)
.RegisterRemoteCommands(typeof(Program).Assembly);