'4.6.0-preview6.19303.8'不是有效的版本字符串。无法在Visual Studio 2013中安装Nuget程序包

问题描述 投票:0回答:1

通常,我在.NET 4.5上工作,我的同事在他的计算机上安装了.NET 4.6.2,给我Project以便我进行更改。

在Nuget控制台中,显示以下错误'4.6.0-preview6.19303.8'不是有效的版本字符串。

我正在努力更新Nuget软件包,它向我显示以下错误,这是什么意思。。

PM> Install-Package Microsoft.Owin.Host.SystemWeb -Version 4.1.0
Attempting to resolve dependency 'Owin (≥ 1.0.0)'.
Attempting to resolve dependency 'Microsoft.Owin (≥ 4.1.0)'.
Installing 'Microsoft.Owin 4.1.0'.
You are downloading Microsoft.Owin from Microsoft, the license agreement to which is available at https://raw.githubusercontent.com/aspnet/AspNetKatana/v4.0.1/LICENSE.txt. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Owin 4.1.0'.
Installing 'Microsoft.Owin.Host.SystemWeb 4.1.0'.
You are downloading Microsoft.Owin.Host.SystemWeb from Microsoft, the license agreement to which is available at https://raw.githubusercontent.com/aspnet/AspNetKatana/v4.0.1/LICENSE.txt. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Owin.Host.SystemWeb 4.1.0'.
Install failed. Rolling back...
Install-Package : '4.6.0-preview6.19303.8' is not a valid version string.
At line:1 char:1
+ Install-Package Microsoft.Owin.Host.SystemWeb -Version 4.1.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], ArgumentException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

任何帮助将不胜感激。谢谢:)

在更新Nuget之后,要知道Nuget是最新的

PM> nuget update -self
Checking for updates from https://api.nuget.org/v3/index.json.
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/index.json
Currently running NuGet.exe 5.5.1.
NuGet.exe is up to date.
Update successful.
c# .net visual-studio nuget
1个回答
0
投票

[它似乎与nuget版本有关,如documentation中所述:

NuGet 4.3.0+支持SemVer 2.0.0,该版本支持带点标记的预发行编号,如1.0.1-build.23中所示。 4.3.0之前的NuGet版本不支持点表示法。您可以使用1.0.1-build23之类的格式。

在您的情况下,4.6.0-preview6.19303.8是“带点标记的预发行编号”(“ preview6”和“ 19303”之间的'。)。

您可以通过在Visual Studio的程序包管理器控制台中键入nuget help来检查您正在使用的nuget版本,然后使用nuget update -self更新它

© www.soinside.com 2019 - 2024. All rights reserved.