Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying to install package provider #10867

Closed
pwm1234 opened this issue Oct 22, 2019 · 4 comments
Closed

error trying to install package provider #10867

pwm1234 opened this issue Oct 22, 2019 · 4 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).

Comments

@pwm1234
Copy link

pwm1234 commented Oct 22, 2019

Steps to reproduce

PS > Install-PackageProvider -Name NuGet -scope CurrentUser

Expected behavior

Nuget provider is installed.

Actual behavior

Install-PackageProvider : Unhandled Exception - Message:'The type initializer for 'Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicType'     threw an exception.' Name:'TypeInitializationException' Stack Trace:'   at     Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicType.Create(Type tInterface, OrderedDictionary`2 instanceMethods, List`2     delegateMethods, List`1 stubMethods, List`2 usedInstances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.CreateProxy(Type tInterface, Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.DynamicCast(Type tInterface, Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.DynamicCast[TInterface](Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterfaceExtensions.As[TInterface](Object instance)
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletBase.get_PackageManagementHost()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletBase.SelectProviders(String[] names)
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletWithProvider.get_SelectedProviders()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider.get_SelectedProviders()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletWithProvider.<get_CachedSelectedProviders>b__23_0()
   at Microsoft.PackageManagement.Internal.Utility.Extensions.DictionaryExtensions.GetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Func`1     valueFunction)
   at Microsoft.PackageManagement.Internal.Utility.Extensions.Singleton`1.GetOrAdd(Func`1 newInstance, Object primaryKey, Object[] keys)
   at Microsoft.PackageManagement.Internal.Utility.Extensions.SingletonExtensions.GetOrAdd[TResult](Object primaryKey, Func`1 newInstance, Object[]     keys)
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletWithProvider.get_CachedSelectedProviders()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletWithProvider.GenerateDynamicParameters()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.AsyncCmdlet.<>c__DisplayClass83_0.<AsyncRun>b__0()'
At line:1 char:1
+ Install-PackageProvider -Name NuGet -scope CurrentUser
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Microsoft.PowerShel\u2026tallPackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
+ FullyQualifiedErrorId : UnhandledException,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider

Environment data

PS > $psversiontable

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Description

I just installed the current release of powershell core 6. I am running into this problem just trying to install the powershell community extensions. Seems like something is wrong with my environment, but I have no idea how to troubleshoot.

I sincerely appreciate any help.

@pwm1234 pwm1234 added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Oct 22, 2019
@iSazonov
Copy link
Collaborator

iSazonov commented Oct 23, 2019

@pwm1234 The cmdlet is not in the repo. Please report to https://github.com/OneGet/oneget.

GitHub
PackageManagement (aka OneGet) is a package manager for Windows - OneGet/oneget

@iSazonov iSazonov added the Resolution-External The issue is caused by external component(s). label Oct 23, 2019
@pwm1234
Copy link
Author

pwm1234 commented Oct 23, 2019

Sorry, but I still need help. I am not sure what to report to oneget. This seems to be a powershell core problem. get-packageprovider seems to be installed:

PS C:\Users\e27290> gcm get-packageprovider

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-PackageProvider                                1.0.0.1    PackageManagement

But when I run it, I get this error:

PS C:\Users\e27290> get-packageprovider
get-packageprovider : Unhandled Exception - Message:'The type initializer for 'Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicType' threw an exception.' Name:'TypeInitializationException' Stack Trace:'   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicType.Create(Type tInterface, OrderedDictionary`2 instanceMethods, List`2 delegateMethods, List`1 stubMethods, List`2 usedInstances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.CreateProxy(Type tInterface, Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.DynamicCast(Type tInterface, Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterface.DynamicCast[TInterface](Object[] instances)
   at Microsoft.PackageManagement.Internal.Utility.Plugin.DynamicInterfaceExtensions.As[TInterface](Object instance)
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletBase.get_PackageManagementHost()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.CmdletBase.SelectProviders(String[] names)
   at Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider.ProcessRecordAsync()
   at Microsoft.PowerShell.PackageManagement.Cmdlets.AsyncCmdlet.<>c__DisplayClass83_0.<AsyncRun>b__0()'
At line:1 char:1
+ get-packageprovider
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Microsoft.PowerShel\u2026.GetPackageProvider:GetPackageProvider) [Get-PackageProvider], Exception
+ FullyQualifiedErrorId : UnhandledException,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProvider

This seems to be a powershell core problem not a oneget problem. (I do not have these problems with powershell.)

@iSazonov
Copy link
Collaborator

@pwm1234 We need to find root of the issue so OneGet repo is best place to start.

@ghost
Copy link

ghost commented Oct 24, 2019

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@ghost ghost closed this as completed Oct 24, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

2 participants