asp.net - Entity Framework Core 迁移失败并显示“无法加载文件或程序集‘System.Threading’”
问题描述
我一直在对以下开源项目进行一些更改:https ://github.com/SevenSpikes/api-plugin-for-nopcommerce
我正在尝试IdentityServer4
将上述项目中引用的库从 2.0.3 更新到 2.4.0。作为此过程的一部分,我需要从以前版本到当前版本的迁移脚本。我还想获得一些生成迁移脚本的经验,因为我以前从未这样做过。
我尝试执行以下命令
> dotnet ef migrations add
> InitialIdentityServerPersistedGrantDbMigration -c
> PersistedGrantDbContext -o /Migrations/IdentityServer/PersistedGrantDb --project "C:\localpath\Nop.Plugin.Api.csproj"
基于以下文档
当我这样做时,我收到以下错误
System.IO.FileLoadException: Could not load file or assembly 'System.Threading, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Console.get_IsOutputRedirected()
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
我试图更新到最新版本的Core 2.2 SDK,但似乎没有帮助。
有点卡住了,希望能得到一些帮助!
解决方案
推荐阅读
- sql - Oracle SQL - 仅在下个月 1 日之前最后一次阅读
- ios - 在元组数组中查找最长长度的字符串
- git - Jenkins 如何将私钥和密码传递给 Git?
- javascript - 当我尝试与浏览器交互时赛普拉斯超时
- vue.js - 如何将容器对齐在中心
- node.js - Discord.js 别名
- javascript - 为什么只有我放在底部的变量在没有 console.log 的情况下被执行?
- javascript - 如何保护 ReactJs 中的路由?
- prolog - 带索引的 Prolog 前缀
- c - 无法在 windows shell 中运行 graphics.h 程序