Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Hacking the GAC, How to enable standard directory browsing

Have you ever wanted to or needed to view the actual contents of the GAC?  Not just what is in the GAC, but actually grab the assemblies that are there? 

I know I have.  You may be asking WHY did you want to grab an assembly that is in the GAC.  2 reasons:

  1. I wanted to move a copy of the assmebly from one box onto my dev box.
  2. I wanted to reflect the the assembly to see how it was build to learn something.

Well, fortunately there is a way to do this.  It is a pretty simple registry hack that works wonders.

Here is how:

  1. Open RegEdit
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
  3. Right click in the viewer and add a new Binary Value
  4. Name your new Binary value DisableCacheViewer
  5. Double click your new entry and given it a value of 1 with Base Hexadecimal
  6. Click OK
  7. Navigate to C:\WINDOWS\assembly
  8. You should see the contents of the folder as sub folders, not the standard GAC Viewer

Hope this helps..... I would be sure to delete or rename this new value AFTER you are done playing around.

**** WARNING **** Any time you modify your registry, you do so at your OWN risk. 

Till next time,


kick it on DotNetKicks.com

Posted 08-30-2007 7:04 AM by Derik Whittaker
Filed under: , ,

[Advertisement]

Comments

DotNetKicks.com wrote Hacking the GAC, How to enable standard directory browsing
on 08-30-2007 8:12 AM

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Kalpesh wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-30-2007 1:45 PM

Wouldn't the good old DOS do?

Derik Whittaker wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-30-2007 2:43 PM

@Kalpesh,

Yes, i guess DOS would do.  But it is not as fun as hacking the registry :)

Klaus Hebsgaard wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-31-2007 3:30 AM

Actually there is a much smarter way.

Run the following command at the command line or in your login script:

subst l: c:\windows\assembly

Now if you go to c:\windows\assembly you get the good old functionality, but if you go to l: you get the directory structure.

Derik Whittaker wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-31-2007 5:44 AM

@Klaus,

I like your way even better.  No need to touch the registry and no need to use DOS.

Thanks,

Matt Casto wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-31-2007 7:52 AM

Klaus beat me to the punch.  I keep a batch file in the root of my USB key that maps the drive and opens an explorer window pointed to it.  I have a SlickRun keyword configured to run this batch file to get to the GAC very quickly whenever I need it.

subst v: %SystemRoot%\assembly

%SystemRoot%\explorer.exe v:\gac_msil

Please note that the above script assumes that the V: drive is not mapped.

Brennan Stehling wrote re: Hacking the GAC, How to enable standard directory browsing
on 08-31-2007 2:11 PM

As a shortcut you could also place the following into a file with a .reg extension. It will set that value for the key described in the blog entry. And to change it back you can create another file which instead sets the value to 0. Then you can go back and forth easily without opening RegEdit.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]

"DisableCacheViewer"=hex:10

links for 2007-09-01 — More Light! More Light! wrote links for 2007-09-01 — More Light! More Light!
on 09-01-2007 2:22 AM

Pingback from  links for 2007-09-01 — More Light! More Light!

Roger Jakobsson wrote re: Hacking the GAC, How to enable standard directory browsing
on 09-01-2007 7:03 AM

Or you could skip using the crappy Windows Explorer and instead use Total Commander, then it shows the GAC as any other folder.

Fady Anwar wrote re: Hacking the GAC, How to enable standard directory browsing
on 09-05-2007 5:01 AM

Nice trick and a kick from me ;)

Dave wrote re: Hacking the GAC, How to enable standard directory browsing
on 09-06-2007 8:26 PM

The one I use is:

c:\windows\assembly\gac

just looks like the regular filesystem

Derik Whittaker wrote re: Hacking the GAC, How to enable standard directory browsing
on 09-06-2007 8:30 PM

@Dave,

What OS version u running?  I don't that on my files ystem.

Dave wrote re: Hacking the GAC, How to enable standard directory browsing
on 09-09-2007 11:44 AM

Sorry you have to do it from start -> run to get it to work (at least on vista you do)

The Daily Grind 1220 at aoortic! dot com wrote The Daily Grind 1220 at aoortic! dot com
on 09-18-2007 10:10 PM

Pingback from  The Daily Grind 1220 at  aoortic! dot com

http://devlicio.us/blogs/derik_whittaker/archive/2007/08/30/hacking-the-gac-how-to-enable-standard-directory-browsing.aspx wrote http://devlicio.us/blogs/derik_whittaker/archive/2007/08/30/hacking-the-gac-how-to-enable-standard-directory-browsing.aspx
on 03-24-2008 3:54 AM
Ultram er. wrote Ultram er.
on 06-08-2008 9:34 PM

Ultram er. Ultram er tablets. Ultram er mg.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)