asp.net mvc 5 脚手架无法检索元数据...找到不明确的匹配项
asp.net mvc5 scaffolding Unable to retrive metadata for ...Ambiguous match found
问题:当我想从 EF codefirst 上下文创建控制器时,它给我这个错误:
There was an error running the selected code generator.Unable to retrieve metadata for Model.class name.Ambiguous match found.
See Error Image
我做了什么?
- 由于我的模型数据在单独的程序集中,我更新了所有包或降级它们但没有任何反应。
- 然后我将我的模型程序集合并到网站项目中,但错误没有解决。
- 在谷歌搜索和许多技巧之后,我为每个 class 创建了干净的项目和脚手架,但似乎只有一个 class 有这个问题。
- 在那class我评论了所有属性并一一取消评论以发现错误。
- 找到了!为此 属性 发生错误
public bool ISActive { get; set; }
我很惊讶,发现 dot net 如何培养你!!
您如何看待解决方案?!!
将 ISActive 属性 重命名为 IsActivated 等其他名称解决了我的 problem.It 似乎 EF 脚手架在 cruding 时存在此类命名问题。
问题:当我想从 EF codefirst 上下文创建控制器时,它给我这个错误:
There was an error running the selected code generator.Unable to retrieve metadata for Model.class name.Ambiguous match found.
See Error Image
我做了什么?
- 由于我的模型数据在单独的程序集中,我更新了所有包或降级它们但没有任何反应。
- 然后我将我的模型程序集合并到网站项目中,但错误没有解决。
- 在谷歌搜索和许多技巧之后,我为每个 class 创建了干净的项目和脚手架,但似乎只有一个 class 有这个问题。
- 在那class我评论了所有属性并一一取消评论以发现错误。
- 找到了!为此 属性 发生错误
public bool ISActive { get; set; }
我很惊讶,发现 dot net 如何培养你!! 您如何看待解决方案?!!
将 ISActive 属性 重命名为 IsActivated 等其他名称解决了我的 problem.It 似乎 EF 脚手架在 cruding 时存在此类命名问题。