MVC Razor view Intellisense broken in VS 2013/2015/2017

后端 未结 22 2203
失恋的感觉
失恋的感觉 2020-11-27 16:52

I have an existing project written in VS2010 which when loaded in VS2010 works perfectly.

When I load this same project in VS2013 the MVC Razor views contain lots of

22条回答
  •  有刺的猬
    2020-11-27 17:44

    MS says that for VS2013 "Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup."

    But if you add these two lines inside each .cshtml the intellisense will work again for MVC3 in VS2013:

    @using System.Web.Mvc.Html
    @inherits System.Web.Mvc.WebViewPage
    

    Instead of dynamic you can put your Model's type.

提交回复
热议问题