diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index fee891f655..c5e58133c2 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -178,6 +178,19 @@ private static void add_assembly_resolver() return typeof(ConsoleApplication).Assembly; } + try + { + if (requestedAssembly.get_public_key_token().is_equal_to(ApplicationParameters.OfficialChocolateyPublicKey) + && requestedAssembly.Name.is_equal_to("chocolatey.licensed")) + { + return Assembly.LoadFile(ApplicationParameters.LicensedAssemblyLocation).UnderlyingType; + } + } + catch (Exception ex) + { + "chocolatey".Log().Warn("Unable to load chocolatey.licensed assembly. {0}".format_with(ex.Message)); + } + return null; }; diff --git a/src/chocolatey/GetChocolatey.cs b/src/chocolatey/GetChocolatey.cs index fe2a30f821..2d5dedbdec 100644 --- a/src/chocolatey/GetChocolatey.cs +++ b/src/chocolatey/GetChocolatey.cs @@ -59,6 +59,19 @@ private static void add_assembly_resolver() return typeof(Lets).Assembly; } + try + { + if (requestedAssembly.get_public_key_token().is_equal_to(ApplicationParameters.OfficialChocolateyPublicKey) + && requestedAssembly.Name.is_equal_to("chocolatey.licensed")) + { + return Assembly.LoadFile(ApplicationParameters.LicensedAssemblyLocation).UnderlyingType; + } + } + catch (Exception ex) + { + "chocolatey".Log().Warn("Unable to load chocolatey.licensed assembly. {0}".format_with(ex.Message)); + } + return null; };