Adding Intellisense for RadControls and Sitefinity Controls in .ASCX Files Placed Inside a Class Library Project

Default Blog Top Image
by ivan georgiev Posted on June 18, 2013
The content you're reading is getting on in years.

This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

If you are using a separate class library project to build your Sitefinity modules you are probably wondering how to enable intellisense for all of the RadControls and Sitefinity controls in your .ascx files that are placed inside that class library as embedded resources. Here I will provide some simple steps to enable that intellisense in Visual Studio.

1. First you have to put Telerik.Sitefinity.dll and Telerik.Web.UI.dll in the GAC. One way to do it is to use the
gacutil.exe. Open your Visual Studio Command Prompt and execute the following commands:

gacutil /i “[path to your dll folder]/Telerik.Sitefinity.dll”
gacutil /i “[path to your dll folder]/Telerik.Web.UI.dll”

2. Then you need to get the assemblies full names. Gacutil.exe can do this for you. Just execute these commands and copy the output.

gacutil.exe /l Telerik.Sitefinity
gacutil.exe /l Telerik.Web.UI

The result from each command should be something like this:



3. You have to place a web.config file in the root directory of your class library project.

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation>
      <assemblies>
        <add assembly="Telerik.Web.UI, Version=2012.3.1308.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
        <add assembly="Telerik.Sitefinity, Version=6.0.4100.0, Culture=neutral, PublicKeyToken=b28c218413bdf563"/>
      </assemblies>
    </compilation>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, Version=2012.3.1308.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
        <add tagPrefix="sitefinity" namespace="Telerik.Sitefinity.Web.UI.Fields" assembly="Telerik.Sitefinity, Version=6.0.4100.0, Culture=neutral, PublicKeyToken=b28c218413bdf563"/>
      </controls>
      <namespaces>
        <add namespace="Telerik.Web.UI" />
        <add namespace="Telerik.Sitefinity.Web.UI" />
      </namespaces>
    </pages>
  </system.web>
</configuration>

4. In you .ascx files register the assemblies with their full names like this

<%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity, Version=6.0.4100.0, Culture=neutral, PublicKeyToken=b28c218413bdf563" Namespace="Telerik.Sitefinity.Web.UI" %>
  
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI, Version=2012.3.1308.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" %>

5. Rebuild your solution and close Visual Studio. After you open it again your intellisense should work.

 

NOTE: I strongly recommend to remove these assemblies from the GAC when you’re finished with your development and you don’t need them anymore.


ivan georgiev
View all posts from ivan georgiev on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
More from the author

Related Products:

Sitefinity

Digital content and experience management suite of intelligent, ROI-driving tools for marketers and an extensible toolset for developers to create engaging, cross-platform digital experiences.

Get started
Prefooter Dots
Subscribe Icon

Latest Stories in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation