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

前端 未结 28 1708
渐次进展
渐次进展 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 04:55

    I have run in the same issue as you, albeit much later. The issue was that I was not able to access Razor views (.cshtml) as I was getting an error stating that I had a missing assembly reference, namely System.Web.Mvc, even though it was in the project references. After investigation, I have noticed that the installed NuGet version was 5.2.3, while the project required 5.2.0. The solution is to downgrade the MVC version.

    1. Go to Project-> NuGet Package Manager.
    2. Search for MVC; it's going to be the first result.
    3. Next is to select downgrade from the drop-down in the details of the NuGet package and submit.

    Confirm all the dialogs and you are ready to go.

提交回复
热议问题