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

前端 未结 28 1716
渐次进展
渐次进展 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:51

    This error means that Visual Studio is unable to locate the System.Web.Mvc assembly to power its intellisense for Razor views. One or both of the following may be required to fix it.

    1. Ensure the version of the .NET framework for the compilation property in the main web.config (the one in the website root) is the same as that specified in the project properties.

    [root]/Web.config:

    
        
    

    Project Properties:

    1. Ensure the version of the MVC assembly specified in the views web.config (the one in the views folder) is the same as the MVC assembly you are using in your project.

    [views folder]/web.config:

    
        
    

    MVC Assembly Reference Properties:

提交回复
热议问题