diff --git a/app/MindWork AI Studio/Program.cs b/app/MindWork AI Studio/Program.cs index b18bdd1d..5a02e9e4 100644 --- a/app/MindWork AI Studio/Program.cs +++ b/app/MindWork AI Studio/Program.cs @@ -21,6 +21,7 @@ internal sealed class Program public static RustService RUST_SERVICE = null!; public static Encryption ENCRYPTION = null!; public static string API_TOKEN = null!; + public static IServiceProvider SERVICE_PROVIDER = null!; public static async Task Main(string[] args) { @@ -148,6 +149,10 @@ internal sealed class Program var programLogger = app.Services.GetRequiredService>(); programLogger.LogInformation("Starting the AI Studio server."); + // Store the service provider (DI). We need it later for some classes, + // which are not part of the request pipeline: + SERVICE_PROVIDER = app.Services; + // Initialize the encryption service: programLogger.LogInformation("Initializing the encryption service."); var encryptionLogger = app.Services.GetRequiredService>();