首页 > 代码库 > uwp - 解决在使用EntityFrameworkCore 指令“add-migration xx” 时 报错“No context type was found in the assembly/no migrations configuration type was found in the assembly”

uwp - 解决在使用EntityFrameworkCore 指令“add-migration xx” 时 报错“No context type was found in the assembly/no migrations configuration type was found in the assembly”

报错截图如下:

技术分享

网上说的办法试过后不行,然后我卸载所有nuget包从头一步步来,终于找到了问题,在到“Add-Migration”这一步,别急执行指令,先重启一下VS,然后再执行指令就可以了,重启前可以重新生成一下项目。

也就是说在创建完数据模型、配置文件app.config等一些列步骤后先重启VS。

uwp - 解决在使用EntityFrameworkCore 指令“add-migration xx” 时 报错“No context type was found in the assembly/no migrations configuration type was found in the assembly”