Home > View Post

Accessing dlls in the GAC

We use EntLib 2.0 where on the project I am currently working on and I bumped into this problem when trying to add a new Exception type to an exception policy.

The problem

Adding an exception type to an exception handling policy when the exception type is contained in an assembly located in the GAC as shown below. How do I add a reference to the correct assembly? When you view the GAC in Windows Explorer you only get a unified view of what it actually contains and it hides the actuall folder structure and its content.

Exception Type Selector

The solution

By using the SUBST dos command you can map the GAC folder to a different drive bypassing the Windows Explorer Shell extention. A more detailed description of this is found here.

SUBST L: C:\Windows\Assembly

After doing this you can browse to the assembly in question no problem as shown below.

GAC folder structure

Once you have added the appropriate reference you simply remove the local drive by running the SUBST command again:


If anyone has found a better way of doing this please leave a comment!


Bruusi Post By Bruusi
4:29 AM
18 May 2007

» Next Post: WPF Hands on labs
« Previous Post: Xaml ObjectDataProvider. They really did think of everything

Comments are closed for this post.

Posted by Matt Dunn @ 18 May 2007 9:26 PM
Hi Bruusi,

There is also a registry key that disables the cache viewer, more on this here:



Posted by Bruusi @ 20 May 2007 2:44 PM
Hi Matt,

Nice, thanks a lot for the tip!


Posted by Brian @ 26 May 2007 9:34 AM
I don't use EntLib 2.0 so I don't exactly follow the problem and this may not be feasible; but couldn't you just point to the the assembly where it was installed at?

For instance we use a GAC'd assembly but it's also installed in the typical Program Files/Company/Product location too. We add a registry key upon installation so that it shows up in the .NET tab when adding references - so if you did something similiar could you just point to the install location? When the assembly is loaded from the location it's going to look in the GAC anyway.

Either way; still a cool tip to know about.

© 2005 - 2022 Josh Twist - All Rights Reserved.