我正在研究EPiserver . 我设置了环境localhost,我创建了一个addOn,现在我正在尝试上传,因为我已经创建了一个.nupkg文件 . 但我收到这个例外:
“'TestAddOn'的架构版本与NuGet的2.0.30619.9119版本不兼容 . 请将NuGet升级到http://go.microsoft.com/fwlink/?LinkId=213942的最新版本 . ”我跑
nuget.exe update -Self
在我的电脑上,但我已经有最新版本 .
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.6.2.
NuGet.exe is up to date.
这里的不匹配是什么?先感谢您 .
UPDATE
这是nuspec文件:
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>Tag1 Tag2</tags>
2 回答
根据错误消息,您的nuget包似乎使用了您正在使用的旧版NuGet不支持的功能 . 您应该更新Visual Studio的NuGet扩展名或
.nuget
文件夹中的nuget.exe
:转到工具>扩展和更新...>选择更新选项卡,查找NuGet包管理器,然后单击更新按钮 . 如果没有更新按钮,您可能需要使用更高版本的VS,例如,Visual Studio 2013,2015 ....
如果项目中有
.neget
文件夹,其中包含nuget.exe,则需要打开CMD并将路径切换到.nuget
文件夹,然后使用命令nuget.exe update -Self
. 如果您的解决方案中未包含任何nuget.exe
,请忽略此建议 .希望这可以帮助 .
它可能很奇怪,但它需要将NuGet.Core包更新到更新的版本 . 例如从2.0.3到2.7.2 .