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
Package references
Microsoft.Extensions.Configuration.Binder10.0.11— binds theRemoteServerconfiguration section.Microsoft.Extensions.DependencyInjection.Abstractions10.0.11— the service collection the commands register into.Microsoft.Extensions.Logging.Abstractions10.0.11—ILogger<T>, which the listener writes through.Microsoft.Extensions.Options10.0.11— reads the bound settings at runtime.
Project references
AlmightyShogun.Utils— provides assembly scanning and inherited-type registration helpers.
Startup Registration
AddRemoteCommands binds the RemoteServer section and registers the listener behind IRemoteCommandHandler, and RegisterRemoteCommands discovers the command classes in the calling assembly and registers each as a transient service. Nothing starts listening on its own: resolve the handler and call StartAsync, usually from a hosted service.
csharp
using AlmightyShogun.RemoteCommands;
builder.Services
.AddRemoteCommands(builder.Configuration)
.RegisterRemoteCommands();