From a12418c96f664e9bda97ea268bf58d3453d35c67 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 12 Jun 2017 18:22:06 -0500 Subject: [PATCH] (GH-371) ensure config is properly set When calling into chocolatey.lib, if the Container is accessed prior to having the configuration all set, any additonal components that Chocolatey attempts to register will be ignored. This causes issues with using Chocolatey and registering licensed configuration and components. Ensure that Chocolatey does get set appropriately by making a call to do that early in the process load. --- Source/ChocolateyGui.Subprocess/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/ChocolateyGui.Subprocess/Program.cs b/Source/ChocolateyGui.Subprocess/Program.cs index aa1a60b38..5d34d2e69 100644 --- a/Source/ChocolateyGui.Subprocess/Program.cs +++ b/Source/ChocolateyGui.Subprocess/Program.cs @@ -17,7 +17,9 @@ using ILogger = Serilog.ILogger; namespace ChocolateyGui.Subprocess -{ +{ + using chocolatey; + public class Program { public static ManualResetEventSlim CanceledEvent { get; private set; } @@ -48,7 +50,11 @@ public static int Main(string[] args) e.Cancel = true; CanceledEvent.Set(); source.Cancel(); - }; + }; + + // do not remove! Load Chocolatey once so all config gets set + // properly for future calls + var choco = Lets.GetChocolatey(); CanceledEvent = new ManualResetEventSlim();