c# - Nuget 无法安装特定版本 2.3.12 的包“RazorGenerator.Mvc”
问题描述
尝试使用以下命令安装具有特定版本 2.3.12 的 Nuget 包“RazorGenerator.Mvc”时出现此错误:
Install-Package RazorGenerator.Mvc -Version 2.3.12
但是,在运行该命令时,Visual Studio 会返回此错误:
Failed to add reference. The package 'RazorGenerator.Mvc' tried to add a framework reference to 'System.Web.Mvc' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance. Cannot find assembly 'System.Web.Mvc'.
我的项目已经安装了最新版本的包“Microsoft.AspNet.Mvc”,我也尝试使用版本 3.0.50813.1 安装这个包,但两次尝试都没有解决错误。你们知道如何解决这个问题吗?包“RazorGenerator.Mvc”的特定版本必须是2.3.12。
解决方案
您可以尝试以下 3 种方法中的任何一种:
从 Nuget 包管理器中,从您的项目中卸载包“Microsoft.AspNet.Mvc”,然后尝试安装包“RazorGenerator.Mvc”的特定版本,即 2.3.12(RazorGenerator.Mvc 将安装所有依赖项)
交叉检查是否不是您的项目目标框架导致此问题。简而言之,检查您的项目是否需要使用 .Net Framework 或 .NetCore 才能安装此 nuget 包。
从 bin/debug 文件夹中删除所有 dll、exe 并尝试再次安装 nuget。
推荐阅读
- mysql - 是否有必要更新 NodeJS - MySQL (Callback) Connections to MariaDB (Promises/async-await)?
- angular - Flex 布局网格格式
- api - 如何从用户字段 LookupId 获取用户
- python - python数据框在没有循环的情况下每组应用函数
- typescript - 如何忽略 NestJs 中某些路由上的全局缓存
- typescript - 'serviceBusTrigger'、'signalR' 绑定类型突然未注册
- xcode - 如何在 Xcode 中更改编辑器的方向?
- javascript - 如何将类别标签与多个系列匹配?
- ios - Xcode 11 的功能中不提供应用内购买
- css - 带有过滤器的 DT::datatable 中的列宽