sql - 为什么 EF6 说我需要应用已经应用的迁移?
问题描述
我正在尝试通过在 PMC 中运行以下命令来添加迁移add-migration usernotes
。
无论如何,我在 _MigrationHistory 表中看到了我的所有迁移,但是当我尝试运行命令说
Unable to generate an explicit migration because the following explicit migrations are pending: <all my migrations that were already applied>. Apply the pending explicit migrations before attempting to generate a new explicit migration
我尝试过
的指定配置名称时出现错误-ConfigurationTypeName CONFIGNAME
(我的配置名称与那个 fyi 不同)。
Enable-Migration
结果 PMC 告诉我迁移已启用
卸载并重新安装 EF
设置启动项目
重建项目
移动所有迁移,以便 EF 不再看到它们
指定连接字符串-ConnectionString
解决方案
好的,所以连接字符串的工作方式是它在启动时拼凑在一起,当我把它们全部放在一起时,像这样:public string ConnStr = "Server=sever_name;Database=db_name;User Id = userid; Password=password;";
,它解决了这个问题。
推荐阅读
- c - 我在 Windows 10 上找不到 /rootfs
- c# - DocuSign JWT Auth Error while requesting server, received a nonsuccessful HTTP code Error with response Body C# sdk
- laravel - 将标头中的刷新令牌发送到 Laravel 后端
- html - 我想取消阻止我的客户网站和我的生产网站从我自己的网站加载资产
- java - 如何在 Spring Boot API 请求中强制执行 DateTime 格式?
- ios - 是否可以从 macOS 应用程序编辑 iOS 文件?
- react-native - 使图像适合视图反应原生
- javascript - 我正在使用 axios 在 React 中制作一个 CRUD Web 应用程序。我收到以下错误:“TypeError: Object(...) is not a function”
- python - 如何使用 selenium 使 chrome 浏览器在后台运行
- python - cv2 断言失败错误,p.checkVector(2, CV_32S) 问题与 FillPoly