首页 > 解决方案 > 将 NuGet 附加包上传到 Episerver 会引发异常

问题描述

我正在研究 EPiserver。我设置了环境 localhost,我创建了一个插件,现在我正在尝试上传,因为我已经创建了一个 .nupkg 文件。但我收到了这个例外:

“'TestAddOn' 的架构版本与 NuGet 的 2.0.30619.9119 版本不兼容。请从http://go.microsoft.com/fwlink/?LinkId=213942将 NuGet 升级到最新版本。”我运行

 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.

这里的不匹配可能是什么?先感谢您。

更新

这是 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>

标签: visual-studionugetepiserver

解决方案


将 NuGet 附加包上传到 Episerver 会引发异常

根据错误消息,您的 nuget 包似乎使用了您正在使用的旧版本 NuGet 不支持的功能。您应该更新 Visual Studio 或文件夹nuget.exe中的 NuGet 扩展.nuget

  1. 更新 Visual Studio 的 NuGet 扩展

    转到工具 > 扩展和更新... > 选择更新选项卡,查找 NuGet 包管理器,然后单击更新按钮。如果没有更新按钮,可能需要使用更高版本的VS,例如Visual Studio 2013,2015....

  2. 文件夹更新:< nuget.exe/.nuget p>

    如果您.neget的项目中有文件夹,其中包含 nuget.exe,则需要打开 CMD 并将路径切换到.nuget文件夹,然后使用命令nuget.exe update -Self。如果您的解决方案中不包含任何内容nuget.exe,请忽略此建议。

希望这可以帮助。


推荐阅读