【问题标题】:Visual Studio 2019 Entity Framework Enable Migrations ErrorVisual Studio 2019 实体框架启用迁移错误
【发布时间】:2019-10-03 17:15:04
【问题描述】:

我有一个小型 ASP.NET Web 应用程序,但由于某种原因,我在包管理器控制台中键入后遇到迁移问题:

PM> Enable-Migrations

控制台抛出此错误

启用迁移:无法将参数绑定到参数“路径”,因为它为空。
在 line:1 char:1
+ 启用迁移
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Enable-Migrations], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Enable-Migrations

我使用 Visual Studio 2019 并通过 NugGet 包管理器安装了 Entity Framework 6.3.0。在我的models 文件夹中还有一个DbContext

我尝试了很多我看到其他人提出的解决方案,但没有一个有效。希望有人有类似的问题。

附言 项目结构是

Project
    - Connected Services
    - Properties
    - References
    - App_Data
    - App_Start
    - Content
    - Controllers
    - fonts
    - Models
    - Scripts
    - Views
    - favicon.iso
    - Global.asax
    - packages.config
    - Web.config

【问题讨论】:

  • 你能在 vs 中发布你的解决方案结构吗?
  • @Oleg 我更新了问题。
  • 尝试删除EF6.3.0。从您的项目中重新添加它,请在此之前重新启动 Visual Studio。此外,安装 Visual Studio 2019 的最新更新。
  • @madreflection 你对解决方法的回答是正确的,它现在有效,希望他们在下次更新 EF 时修复它谢谢你们俩

标签: c# asp.net .net entity-framework-6


【解决方案1】:

Olá, Eu tive esse mesmo problema em um projeto pessoal, e após algumas horas de teste consegui resolver da seguinte forma: 1 - Acesse Ferramentas > Gerenciador de pacotes do NuGet > Gerenciador de pacotes do NuGet para solução.

2 - Desinstale o EntityFramework 6.3.0 “que foi o meu caso”,安装了版本 6.2.0,feito isso,Recompilar Solução,em seguida rode o comando > Enable-Migrations

Enable Migration success

【讨论】:

  • 请在您使用普通stackoverflow时,在您的问题和答案中使用英文,请改用pt.stackoverflow.com
猜你喜欢
  • 2015-07-13
  • 1970-01-01
  • 1970-01-01
  • 2013-08-02
  • 2021-07-01
  • 2013-09-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多