Why don't my Html Helpers have intellisense?

后端 未结 9 1561
無奈伤痛
無奈伤痛 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:35

    I tried to solve an issue like this one yesterday. I had e pre-compiled dll (project name ie: MyHtmlHelpers) containing helpers and lot of other classes.

    I had the assembly referenced in the web project and the all "standard"-helpers showed up in intellisense but, even though I added the namespace to both web.config in the root and in the views-folder nothing worked. When running the project helpers works, but not in intellisense.

    I added a new class and wrote a new html helper inside the web project, added the namespace to web.config. And that worked.

    After some hours add tried my last card, adding the MyHtmlHelpers-project to the same solution as my webproject. That did the trick. I diden't change anything in the configs just added the project to the same solution and changed the reference to point at the project insted of the compiled dll.

    Isen't that strange? A VS-bug?

提交回复
热议问题