打开Nuget包管理控制台

时间:2017-03-08 05:22:33

标签: powershell nuget visual-studio-2017 powershell-v5.0 nuget-console

每当我在新的VS 2017会话中打开包管理器控制台时,它会显示以下两条错误消息,并且所有意图和目的都正常运行。至少对于像Install-Package这样的普通命令。

Join-Path : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'ChildPath'. Specified method is not supported.
At C:\Dev\.NET\Projects\AcmeSoft\Code\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\init.ps1:13 char:57
+ ... rPackageDirectory = Join-Path $packageDirectory $compilerPackage.Name
+                                                     ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Join-Path], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.JoinPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Dev\.NET\Projects\AcmeSoft\Code\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\init.ps1:14 char:44
+ ... erPackageToolsDirectory = Join-Path $compilerPackageDirectory 'tools'
+                                         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

第一个违规行是:

$compilerPackageDirectory = Join-Path $packageDirectory $compilerPackage.Name

错误在$compilerPackage.Name(即“char:57”)

第二行的违规行是:

$compilerPackageToolsDirectory = Join-Path $compilerPackageDirectory 'tools'

错误在$compilerPackageDirectory 'tools'

任何拥有比我更多Nuget和PowerShell技能的人都可以解释为什么会发生这种情况,以及如何解决这个问题,好吗?

0 个答案:

没有答案