GAC and User Controls

Discussion in 'ASP .Net' started by Manuel Lopez, Dec 2, 2003.

  1. Manuel Lopez

    Manuel Lopez Guest

    Hello,

    We have user controls that we want to share between
    applications.

    We have a web app that has only the ascx, this is a sub
    virtual root of all our applications.

    What we have done is generated a dll will all the codehind
    of the User Controls.

    This dll is registered in the GAC, and the other
    applications reference the location of the dll.(It doesn´t
    copy the assembly, which is what it´s supposed to do)

    The problem is when we load a page that uses one of these
    user controls, we get an error that it can load type:

    <%@ Control Language="vb" AutoEventWireup="false"
    Inherits="UserControls.Header"
    TargetSchema="http://schemas.microsoft.com/intellisense/ie5
    " %>

    If i copy the UserControls.dll to the BIN folder of the
    Web application everything works fine.

    But then what it´s the use of the GAC'ed dll?

    Is it possible to inherit in the control directive from a
    dll that is not in the bin folder?

    Many Thanks,

    Manuel
    Manuel Lopez, Dec 2, 2003
    #1
    1. Advertising

  2. You probably need to indicate to ASP.NET to look in the
    GAC for the assembly in question. This is done by adding
    an <assemblies> tag to the <compilation> section in
    web.config. For example.

    <compilation defaultLanguage="c#" debug="true">
    <assemblies>
    <add assembly="ObjectSharp.Logging,
    Version=1.0.202.720, Culture=neutral,
    PublicKeyToken=ebe272337da14566" />
    </assemblies>
    </compilation>

    Keep in mind that the assembly attribute needs to be on a
    single line, regardless of how this breaks in this
    message.

    Bruce Johnson
    http://www.ObjectSharp.com/Bruce

    >-----Original Message-----
    >Hello,
    >
    >We have user controls that we want to share between
    >applications.
    >
    >We have a web app that has only the ascx, this is a sub
    >virtual root of all our applications.
    >
    >What we have done is generated a dll will all the

    codehind
    >of the User Controls.
    >
    >This dll is registered in the GAC, and the other
    >applications reference the location of the dll.(It

    doesn´t
    >copy the assembly, which is what it´s supposed to do)
    >
    >The problem is when we load a page that uses one of

    these
    >user controls, we get an error that it can load type:
    >
    ><%@ Control Language="vb" AutoEventWireup="false"
    >Inherits="UserControls.Header"
    >TargetSchema="http://schemas.microsoft.com/intellisense/i

    e5
    >" %>
    >
    >If i copy the UserControls.dll to the BIN folder of the
    >Web application everything works fine.
    >
    >But then what it´s the use of the GAC'ed dll?
    >
    >Is it possible to inherit in the control directive from

    a
    >dll that is not in the bin folder?
    >
    >Many Thanks,
    >
    >Manuel
    >
    >
    >.
    >
    Bruce Johnson, Dec 2, 2003
    #2
    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. Lenard Gunda

    Custom controls and the GAC

    Lenard Gunda, Sep 23, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,405
    =?Utf-8?B?Sm9uIEFsc2lw?=
    Oct 7, 2004
  2. Colin Orr via .NET 247

    Problems with User Controls in IE from the GAC

    Colin Orr via .NET 247, Nov 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    337
    chanmmn
    Nov 17, 2004
  3. Colin Orr via .NET 247

    Problems with User Controls in IE from the GAC

    Colin Orr via .NET 247, Jan 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    327
    Scott Allen
    Jan 24, 2005
  4. Manuel Lopez

    Import of a User Control in GAC

    Manuel Lopez, Dec 3, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    145
    Manuel Lopez
    Dec 3, 2003
  5. Faizan Ahmed
    Replies:
    1
    Views:
    272
    John Saunders
    Jan 4, 2005
Loading...

Share This Page