Why don't my Html Helpers have intellisense?

后端 未结 9 1556
無奈伤痛
無奈伤痛 2020-12-06 15:54

I can\'t get intellisense for my own html helpers. My CustomHtmlHelpers.cs looks like this:

using System.Web.Mvc;
using System.Text;
using Syste         


        
相关标签:
9条回答
  • 2020-12-06 16:46

    I ran into this today as well. Sometimes just closing the Razor view's window in Visual Studio and re-opening it will do the trick without having to do a full Visual Studio restart.

    0 讨论(0)
  • 2020-12-06 16:47

    I found that if it still doesn't work, you may need to go to the properties of the custom class and change the build action from "content" to "compile". That resolved it for me.

    0 讨论(0)
  • 2020-12-06 16:53

    I found that i was adding the reference to the wrong web.config. It's not the main config but the web.config in the views directory...

    0 讨论(0)
提交回复
热议问题