PowerShell/Polaris

Error message after PowerShell upgrade to 6.2

datenschieber opened this issue · 2 comments

Upgraded PowerShell Core to 6.2. After the upgrade Polaris 0.2.0 fails with the following error messages (running the Polaris app from the Getting Started guide):

Cannot convert the "System.Collections.Generic.List`1[PolarisMiddleWare]" value of type "System.Collections.Generic.List`1[[PolarisMiddleWare, PowerShell Class Assembly, Version=1.0.0.24, Culture=neutral, PublicKeyToken=null]]" to type "PolarisMiddleWare".
At /usr/local/share/powershell/Modules/Polaris/0.2.0/lib/Polaris.Class.ps1:9 char:76
+ ... iddleWare = [System.Collections.Generic.List[PolarisMiddleWare]]::new ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : ConvertToFinalInvalidCastException
 
You cannot call a method on a null-valued expression.
At /usr/local/share/powershell/Modules/Polaris/0.2.0/Public/New-PolarisRoute.ps1:89 char:17
+                 $Polaris.AddRoute( $Path, $Method, $Scriptblock )
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
 
Cannot convert the "System.Collections.Generic.List`1[PolarisMiddleWare]" value of type "System.Collections.Generic.List`1[[PolarisMiddleWare, PowerShell Class Assembly, Version=1.0.0.24, Culture=neutral, PublicKeyToken=null]]" to type "PolarisMiddleWare".
At /usr/local/share/powershell/Modules/Polaris/0.2.0/lib/Polaris.Class.ps1:9 char:76
+ ... iddleWare = [System.Collections.Generic.List[PolarisMiddleWare]]::new ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : ConvertToFinalInvalidCastException
 
You cannot call a method on a null-valued expression.
At /usr/local/share/powershell/Modules/Polaris/0.2.0/Public/Start-Polaris.ps1:79 char:5
+     $Polaris.Start( $Port, $Https.IsPresent, $Auth)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Environment:

Name                           Value
----                           -----
PSVersion                      6.2.0
PSEdition                      Core
GitCommitId                    6.2.0
OS                             Darwin 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Hey @datenschieber were you able to resolve this on your own?

Seems to be a local only problem. After having updated Visual Studio Code the problem disappeared. Strange but true...