Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GAC and User Controls

Reply
Thread Tools

GAC and User Controls

 
 
Manuel Lopez
Guest
Posts: n/a
 
      12-02-2003
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


 
Reply With Quote
 
 
 
 
Bruce Johnson
Guest
Posts: n/a
 
      12-02-2003
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
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with User Controls in IE from the GAC Colin Orr via .NET 247 ASP .Net 1 01-24-2005 01:40 AM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Building Controls 1 01-04-2005 04:09 PM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Web Controls 1 01-04-2005 04:09 PM
Problems with User Controls in IE from the GAC Colin Orr via .NET 247 ASP .Net 1 11-17-2004 02:09 PM
Custom controls and the GAC Lenard Gunda ASP .Net 4 10-07-2004 01:49 PM



Advertisments