You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NuGet garelly may return 503:Server Unavailable in some cases.
but following default exception message is difficult to understand.
Exception calling "InstallPackage" with "4" argument(s): "One or more errors occurred."
At C:\Users\altrive\Documents\WindowsPowerShell\Modules\PSNuGet\Scripts\Use-NuGetPackage.ps1:47 char:9
+ $manager.InstallPackage($PackageId, $Version, $true, $Include ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : AggregateException
It need to handle exception properly.
Error Details
$error[0].exception | select *
ErrorRecord : Exception calling "InstallPackage" with "4" argument(s): "One or more errors occurred."
StackTrace : at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception
exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
at CallSite.Target(Closure , CallSite , PackageManager , String , String , Boolean , SwitchParameter )
at System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1,
T2 arg2, T3 arg3, T4 arg4)
at System.Management.Automation.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
WasThrownFromThrowStatement : False
Message : Exception calling "InstallPackage" with "4" argument(s): "One or more errors occurred."
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: An error
occurred while loading packages from 'https://go.microsoft.com/fwlink/?LinkID=397631&clcid=0x409': The remote
server returned an error: (503) Server Unavailable. ---> System.Net.WebException: The remote server returned
an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at NuGet.RequestHelper.GetResponse(Func`1 createRequest, Action`1 prepareRequest, IProxyCache proxyCache,
ICredentialCache credentialCache, ICredentialProvider credentialProvider)
at NuGet.HttpClient.GetResponse()
at NuGet.RedirectedHttpClient.GetResponseUri(HttpClient client)
at NuGet.RedirectedHttpClient.EnsureClient()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at NuGet.RedirectedHttpClient.get_CachedClient()
at NuGet.RedirectedHttpClient.get_Uri()
at NuGet.DataServicePackageRepository.get_Context()
at NuGet.DataServicePackageRepository.FindPackagesById(String packageId)
--- End of inner exception stack trace ---
at NuGet.DataServicePackageRepository.FindPackagesById(String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken
cancellationToken)
at NuGet.AggregateRepository.FindPackagesById(String packageId)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId,
SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions,
Boolean allowUnlisted)
at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository
localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version,
Boolean allowPrereleaseVersions)
at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean
ignoreDependencies, Boolean allowPrereleaseVersions)
at CallSite.Target(Closure , CallSite , PackageManager , String , String , Boolean , SwitchParameter )
---> (Inner Exception #0) System.InvalidOperationException: An error occurred while loading packages from
'https://go.microsoft.com/fwlink/?LinkID=397631&clcid=0x409': The remote server returned an error: (503)
Server Unavailable. ---> System.Net.WebException: The remote server returned an error: (503) Server
Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at NuGet.RequestHelper.GetResponse(Func`1 createRequest, Action`1 prepareRequest, IProxyCache proxyCache,
ICredentialCache credentialCache, ICredentialProvider credentialProvider)
at NuGet.HttpClient.GetResponse()
at NuGet.RedirectedHttpClient.GetResponseUri(HttpClient client)
at NuGet.RedirectedHttpClient.EnsureClient()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at NuGet.RedirectedHttpClient.get_CachedClient()
at NuGet.RedirectedHttpClient.get_Uri()
at NuGet.DataServicePackageRepository.get_Context()
at NuGet.DataServicePackageRepository.FindPackagesById(String packageId)
--- End of inner exception stack trace ---
at NuGet.DataServicePackageRepository.FindPackagesById(String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
The text was updated successfully, but these errors were encountered:
NuGet garelly may return 503:Server Unavailable in some cases.
but following default exception message is difficult to understand.
It need to handle exception properly.
Error Details
The text was updated successfully, but these errors were encountered: