Problem adding a reference via Register directive

Discussion in '.NET' started by leeanne, Feb 10, 2009.

  1. leeanne

    leeanne

    Joined:
    Sep 16, 2008
    Messages:
    2
    I need to modify an .aspx page to include a custom toolbar. The toolbar was created as a User Control, compiled as MyCompany.Tool.dll (strongly named) and added to the GAC. I have referenced it in the .aspx page as follows:

    <%@ Register Tagprefix="mycompany" Namespace="Tools" Assembly="MyCompany.Tools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60642d8f43fa6635" %>
    <%@ Import Namespace="Tools" %>

    In the aspx page, it is called as follows:
    <mycompany:HeaderControl ID="CreateHeader" runat="server" />

    The following is automatically generated in the .aspx.designer.cs page:
    protected global::Tools.HeaderControl CreateHeader;

    I've added the following to the web.config file in the project:
    <compilation debug="true">
    <assemblies>
    <add assembly="MyCompany.Tools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60642d8f43fa6635"/>
    </assemblies>
    </compilation>

    <pages>
    <namespaces>
    <add namespace="Tools" />
    </namespaces>
    <controls>
    <add tagPrefix="mycompany" namespace="MyCompany.Tools" assembly="Tools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60642d8f43fa6635"/>
    </controls>
    </pages>

    When I compile, I get the following error:
    The type of namespace name 'Tools' could not be found in the global namespace (are you missing an assembly reference?)

    I can't figure out what I'm missing. All my searching has led to instructions indicating this is how it should be done.
    leeanne, Feb 10, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sergey Polyakov
    Replies:
    0
    Views:
    389
    Sergey Polyakov
    May 24, 2004
  2. Dan
    Replies:
    3
    Views:
    596
    =?Utf-8?B?RGFu?=
    Jun 14, 2004
  3. =?Utf-8?B?UGF1bCBQcmV3ZXR0?=

    Null Reference Exception on @Register Directive

    =?Utf-8?B?UGF1bCBQcmV3ZXR0?=, Sep 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    305
    =?Utf-8?B?UGF1bCBQcmV3ZXR0?=
    Sep 27, 2006
  4. Arnaud PICHERY

    Adding a Register directive to an aspx page programmatically

    Arnaud PICHERY, Nov 16, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    375
    Teemu Keiski
    Nov 18, 2003
  5. Paul Prewett

    Null Reference Exception on Register Directive

    Paul Prewett, Sep 27, 2006, in forum: ASP General
    Replies:
    2
    Views:
    131
    Anthony Jones
    Sep 27, 2006
Loading...

Share This Page