Reference GAC assemblies for ASP.NET applications

G

Guest

I'd like to reference the SQLHelper.dll from the Microsoft Application Data
Block. I've created an installer which installs it into the GAC. From reading
articles, I've noted that the GAC enumerates by path; hence, you cannot
reference your own assemblies in VS.NET (lame!) The way to do it for web
applications seems to be to add a line in web config.

Looking at .NET reflector, the information for the assembly is:

SQLHelper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5f160e8905c2c21e

My web.config entry is:

<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="SQLHelper, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=5f160e8905c2c21e"/>
</assemblies>
</compilation>

Unfortunately, this doesn't work. I don't want to litter my webserver with
multiple copies of this dll, nor repetitively include the SqlHelper.cs file
in each project. Other ways to get this to work?

I've also tried this by prepending the namespace of the dll, but that
doesn't work either. (Not that it should). From my understanding, this
complete 4-part name should be everything the CLR needs to find the assembly,
and it should be looking in the GAC, and I've verified that the assembly is
indeed in the webserver's GAC.

Also, the "Select a Discussion Group" drop down doesn't work for me on
either IE6 or Firefox. IE6 in particular appears to kill the popups, even
when http://msdn.microsoft.com is in a trusted zone and allowed popups. This
prevents posting first and selecting a discussion group. Instead, one must
navigate directly to the newsgroup so that it is automatically filled in.

Most frustrating.
 
G

Guest

I also looked at another way of doing it, detailed here:

http://aspalliance.com/articleViewer.aspx?aId=76&pId=-1

This involves copying the assembly to a common folder, and then adding a
registry key pointing to that folder so that Visual Studio sees a reference.
Unfortunately, you lose side-by-side versioning, which was a major reason for
using the GAC ....

The problem is, I don't want to do this manually, I want to set up an
installer package to do it.

Unfortunately, the Visual Studio 2003 setup packages don't let you access
the entire registry. You can make a key called HKLM\Software\whatever, but
you can't actually add the key to
\\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders

Any ways around this?
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top