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

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

    If you get this in only one or two CSHTML files... it's a corrupt file.

    I've had this happen with a corrupt file that has some hidden unicode characters. Try copying all the text of the document to a fresh notepad instance. Clear the contents of the original file and save... if the file length is > 0, there's something awry.

    Delete the file and save your notepad instance over the old version. All the errors went away for me.

    I've had this happen a couple of times in my solution. Not sure what's causing it, but I suspect it's Resharper screwing up when it starts to swallow huge chunks of memory into the abyss.

    Am I the only one who has a love / hate relationship with Resharper?

提交回复
热议问题