Custom controls and the GAC

L

Lenard Gunda

Hi!

I haved created a rendered custom control, placed it in a class library
(DLL), assigned a strong name and installed in the GAC. I also have other
utilities, that are in class libraries, and are in the GAC. All of these are
used from my webpage, and my webpage references them, and they also
reference one another.

I add all references of the DLLs to the project, compile and run the
project.

Now everything is accessed from the GAC (I mean my class libraries),
however, if a copy of that one single class library that has the custom
control is not in the application bin\ folder, then the page refuses to
load. It complains at the @Register directive, saying and cannot load this
one assembly, and lists me paths, where it wanted to find it. It doesn't
list the GAC, however.

When I copy this particular .DLL to the application bin\ folder, the
application works ok When I check what DLLs the aspnet_wp process has
loaded, however, I have to see, that even this DLL is used from the GAC.
Somehow, it's just it requires it to start the application when it is
accessed, but then it still uses the version from the GAC.

Is this a bug on ASP.NET, or am I doing something wrong?

Thanks

Lenard
 
M

Martin Dechev

Hi, Lenard,

What is the value for the "Local Copy" property of the reference to the dll
in question in the VS project for the application? If it is True try setting
it to False.

Hope this helps
Martin
 
G

Guest

I've encountered the exact same issue and it could prove to be a hinderance
to our own deployment strategy if I cannot find a resolution.

Everything works fine until I set the Local Copy to False. Pages that make
use of the library through code work fine. But pages with the @ Register
directive are producing the same error that Lenard is reporting.

This seems to be telling me that (for whatever reason) the segement of the
runtime environment that is executing code behind assemblies is resolving
assembly references diferently than the way that ASP.NET is doing it for the
@ Register directive.
 
N

Nicola Dompierre

Hi,

1. remove your custom control from your webpage.
2. in the references, set local copy (of your custom control) to false
3. add your custom control to the gac
4. restart visual studio.net
5. drag your custom control to your web page
 
G

Guest

That worked and I can see now why it wasn't working before.
The Register directive was not specifying the Version and PublicKeyToken in
the Assembly attribute. After following the steps that you specified, it
does.

Thanks.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top