GAC and User Controls

  • Thread starter Thread starter Manuel Lopez
  • Start date Start date
M

Manuel Lopez

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
 
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top