为什么我不能在Update-Package中指定版本?

时间:2021-06-19 07:26:14

This has to be a bug:

这必须是一个错误:

Update-Package Newtonsoft.Json -Reinstall -Version 6.0.0.0

更新包Newtonsoft.Json -Reinstall -Version 6.0.0.0

Error:

错误:

    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

1 个解决方案

#1


5  

Check the version. Maybe it should be 6.0.1?

检查版本。也许它应该是6.0.1?

Update-Package Newtonsoft.Json -Reinstall -Version 6.0.1

更新包Newtonsoft.Json -Reinstall -Version 6.0.1

EDIT: Version not required since you included "Reinstall"
Update-Package -Reinstall Newtonsoft.Json

编辑:由于您包含“重新安装”Update-Package -Reinstall Newtonsoft.Json,因此不需要版本

EDIT: Install specific version (leave out -Version to default to latest version)
Install-Package Newtonsoft.Json -Version 6.0.1

编辑:安装特定版本(省略-Version默认为最新版本)安装包Newtonsoft.Json -Version 6.0.1

EDIT: Update to a specific version
Update-Package Newtonsoft.Json -Version 6.0.1

编辑:更新到特定版本Update-Package Newtonsoft.Json -Version 6.0.1

#1


5  

Check the version. Maybe it should be 6.0.1?

检查版本。也许它应该是6.0.1?

Update-Package Newtonsoft.Json -Reinstall -Version 6.0.1

更新包Newtonsoft.Json -Reinstall -Version 6.0.1

EDIT: Version not required since you included "Reinstall"
Update-Package -Reinstall Newtonsoft.Json

编辑:由于您包含“重新安装”Update-Package -Reinstall Newtonsoft.Json,因此不需要版本

EDIT: Install specific version (leave out -Version to default to latest version)
Install-Package Newtonsoft.Json -Version 6.0.1

编辑:安装特定版本(省略-Version默认为最新版本)安装包Newtonsoft.Json -Version 6.0.1

EDIT: Update to a specific version
Update-Package Newtonsoft.Json -Version 6.0.1

编辑:更新到特定版本Update-Package Newtonsoft.Json -Version 6.0.1