Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET MVC > General Discussions > Cannot use Telerik intellisense in Razor views, when these Views are in Class library

Not answered Cannot use Telerik intellisense in Razor views, when these Views are in Class library

Feed from this thread
  • Pavol avatar

    Posted on May 23, 2011 (permalink)

    Hello,

    I'm working on project in ASP.NET MVC. I want to create module architecture. It means, that I want to create modules, in which I'm using Portable Areas and then with MEF I dynamically load this modules. And I have big problem with this one.

    Because each module is Class library project, I cannot add @using statement for Telerik controls in Razor views. So I added reference to Telerik.Web.Mvc in Class library. From normal C# class (from Controllers and so on) I'm able to type using Telerik.Web.Mvc.UI.

    But when I try this in Razor view, when I want to type @using Telerik.Web.Mvc.UI, I don't have ability to choose Telerik. The reference is added correctly, because when I create for example Grid in View, when I run app, everything works.

    So problem is with the way, how Razor views load information for Intellisense. I added web configs, so Intellisense for Html helpers works, but not for Telerik. Of course, everything works fine, when I use MVC3 web application project, but not with Class library.

    Do you know about this problem, or do you know, about some specific steps, which I have to accomplish to turn on intellisense for Telerik ?

    Thanks.

    Reply

  • Mario avatar

    Posted on May 26, 2011 (permalink)

    Hello Pavol,
    i am almost in the same situation.
    Did you find any solution to your problem?

    Thanks
    Mario

    Reply

  • Vir avatar

    Posted on Jul 8, 2011 (permalink)

    Need help with the same. Can anyone from telerik provide solution for intellisense for telerik controls on MVC 3?  Thanks,

    Reply

  • Gregory avatar

    Posted on Sep 6, 2011 (permalink)

    I am having the exact same issue.  Works fine, until you get into Areas.  Even adding the namespace to the Web.Config in the areas does not help.  Html.Telerik() simply isn't recognized.

    Reply

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Sep 7, 2011 (permalink)

    Hello guys,

    Generally speaking, MVC Contrib is an external project and at this point I cannot tell what the reason for the problem is. If you send us a sample project where the problem,  that you refer to, can be reproduced, we will check it and do our best to help you.



    Kind regards,
    Georgi Tunev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

    Reply

  • Daniele avatar

    Posted on Oct 6, 2011 (permalink)

    Same problem here.. Intellisense simply doesn't recognize Html.Telerik(), even with @using statements and namespaces registered in web.config.

    Reply

  • andrew avatar

    Posted on Oct 7, 2011 (permalink)

    i think you need a web.config in the root folder of your portable area.  try using these settings and placing it.

    <?xml version="1.0"?>
    <configuration>
        <system.web>
            <compilation debug="true" targetFramework="4.0">
                <assemblies>
                    <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                </assemblies>
            </compilation>
     
            <pages>
                <namespaces>
                    <add namespace="System.Web.Helpers" />
                    <add namespace="System.Web.Mvc" />
                    <add namespace="System.Web.Mvc.Ajax" />
                    <add namespace="System.Web.Mvc.Html" />
                    <add namespace="System.Web.Routing" />
                    <add namespace="System.Web.WebPages"/>
                    <add namespace="Telerik.Web.Mvc.UI" />
                </namespaces>
            </pages>
        </system.web>
    </configuration>

    Reply

  • Nathan Smith avatar

    Posted on Jan 30, 2012 (permalink)


    I ran into this same problem and managed to get intellisense working by doing the following:

    1. Start -> Programs -> Visual Studio -> Visual Studio Tools -> Visual Studio Command Prompt

    2. From the command prompt type in

    GacUtil /i *PATH_TO_DLL_REFERENCED_IN_PROJECT*\Telerik.Web.Mvc.dll

    You should get the message "Assembly successfully added to the cache"

    3. At the command prompt type in

    GacUtil /l Telerik.Web.Mvc

    You should get a message similar to the following:

    The Global Assembly Cache contains the following assemblies:
      Telerik.Web.Mvc, Version=2011.3.1306.340, Culture=neutral, PublicKeyToken=121f
    ae78165ba3d4, processorArchitecture=MSIL

    4. Copy the assembly information from the command line into the VIEWS\Web.Config of your project in the section of
    <system.web>
      <pages ...>
        <controls>

    in the form of an <add assembly> line:

    <add assembly="Telerik.Web.Mvc, Version=2011.3.1306.340, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.Mvc.UI" tagPrefix="Tel" />

    5. Add the above <add assembly> entry into the PROJECT's Web.Config under the section of
    <system.web>
        <compilation ...>
          <assemblies>

    but without the Namespace and tagPrefix attributes

    <add assembly="Telerik.Web.Mvc, Version=2011.3.1306.340, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

    6. Make sure both Web.Config files have an entry under the section
    <pages>
      <namespaces>

    for

    <add namespace="Telerik.Web.Mvc.UI"/>

    Build your solution and you should be good to go.

    Reply

  • Douglas avatar

    Posted on Apr 3, 2012 (permalink)

    I did all of this and Intellisense still doesn't work

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET MVC > General Discussions > Cannot use Telerik intellisense in Razor views, when these Views are in Class library