The type 'Expression<>' is defined in an assembly that is not referenced

前端 未结 28 1614
渐次进展
渐次进展 2020-12-24 04:39

In ASP.NET MVC 4.5.2 Framework.

after typing

@Html.LabelFor()
or 
@Html.EditorFor()

in view

I\'m getting Error: The

28条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 05:07

    If none of the answers work use this one. I faced the same issue! Actually configuration.cs file in migrations folder was missing/deleted. I did delete migrations folder and also did delete migrations table from database. Next in Package Manager Console (PM) used following commands:

    Enable-Migrations -Force
    Add-Migration Initial
    update-database
    

    This process recreated the configuration.cs file and everything worked perfectly!

提交回复
热议问题