PDA

View Full Version : Referencing installed DLLs from the GAC


moquette
11-29-2003, 09:11 AM
Hello all, I'm attempting to reference some of our installed comonents like AspNetMX and AspNetMail from the Global Cache Assembly. I found the following on AspNetMail knowledge base:

Solution 5: Some customers are in a hosted environment, and do not have access to the aspNetEmail.dll, or would rather reference the aspNetEmail.dll that is installed in the GAC (Global Assembly Cache). To do this, you will need to add an <assembly> tag to the web.config file.

Locate the <system.web> tag, and add the following entry:(here is a complete example).

<configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="aspNetEmail, Version=2.0.0.1, Culture=neutral, PublicKeyToken=bc571e8da1c1f543"/>
</assemblies>
</compilation>
</system.web>
</configuration>


Make sure the version and public key token match the properties of the GAC installed copy. You may need to get this information from your server administrator. The GAC installed copy can usually be found in c:\winnt\assembly\


After trying the above, I received the following error:

File or assembly name aspNetEmail, or one of its dependencies, was not found.

I'm assuming thta the version and public key token are not matching.

Would someone please point me in the right direction. I need to reference these DLLs in order to use the "CodeBehind" model of Visual Studio.

Thanks,
Anthony.

pjoyce
11-29-2003, 09:44 AM
Anthony,

I assume that you mean you are having problems on your development machine. If you have already downloaded and installed the files, they were (probably) added to your Global Assembly Cache (GAC) already. All you need to do is add a reference to them in your project.

To do this in Visual Studio, got to Project|Add Reference. A dialog box will appear listing all of the items in your GAC. If you don't see and entry for aspNetEMail, then the dll is not in your GAC. The dll does not have to be in your GAC, you can reference it by hitting the Browse... button and finding the DLL on your hard drive.

After that, you should have no problems.

peter.

[b]quote:Originally posted by moquette

Hello all, I'm attempting to reference some of our installed comonents like AspNetMX and AspNetMail from the Global Cache Assembly. I found the following on AspNetMail knowledge base:
[...]
Would someone please point me in the right direction. I need to reference these DLLs in order to use the "CodeBehind" model of Visual Studio.

Thanks,
Anthony.
</blockquote id="quote"></font id="quote">