Fix PackageManagement issue in the latest Alpah12 on Linux (#2665)

* Registry.LocalMachine throws on non-windows platform.

* address cr feedback
This commit is contained in:
Dongbo Wang
2016-11-14 12:51:36 -08:00
committed by GitHub
@@ -1037,10 +1037,15 @@ namespace Microsoft.PackageManagement.Internal.Implementation {
throw new ArgumentNullException("request");
}
#if CORECLR
var providerAssemblies = Enumerable.Empty<string>();
#else
//looks like registry needs to be here for supporting .msi packages
var providerAssemblies = (_initialized ? Enumerable.Empty<string>() : _defaultProviders)
.Concat(GetProvidersFromRegistry(Registry.LocalMachine, "SOFTWARE\\MICROSOFT\\PACKAGEMANAGEMENT"))
.Concat(GetProvidersFromRegistry(Registry.CurrentUser, "SOFTWARE\\MICROSOFT\\PACKAGEMANAGEMENT"));
#endif
#if !COMMUNITY_BUILD
// todo: these should just be strong-named references. for now, just load them from the same directory.