为什么我不能在 Update-Package 中指定版本?
Why can't I specify version in Update-Package?
这一定是一个错误:
Update-Package Newtonsoft.Json -Reinstall -Version 6.0.0.0
错误:
Update-Package : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Update-Package Newtonsoft.Json -Reinstall -Version 6.0.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Update-Package], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
检查版本。也许应该是 6.0.1
?
Update-Package Newtonsoft.Json -Reinstall -Version 6.0.1
编辑:不需要版本,因为您包含了“重新安装”
Update-Package -Reinstall Newtonsoft.Json
编辑:安装特定版本(省略-Version
默认为最新版本)
Install-Package Newtonsoft.Json -Version 6.0.1
编辑:更新到特定版本
Update-Package Newtonsoft.Json -Version 6.0.1
这一定是一个错误:
Update-Package Newtonsoft.Json -Reinstall -Version 6.0.0.0
错误:
Update-Package : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Update-Package Newtonsoft.Json -Reinstall -Version 6.0.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Update-Package], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
检查版本。也许应该是 6.0.1
?
Update-Package Newtonsoft.Json -Reinstall -Version 6.0.1
编辑:不需要版本,因为您包含了“重新安装”
Update-Package -Reinstall Newtonsoft.Json
编辑:安装特定版本(省略-Version
默认为最新版本)
Install-Package Newtonsoft.Json -Version 6.0.1
编辑:更新到特定版本
Update-Package Newtonsoft.Json -Version 6.0.1