If you try to open an assembly from the GAC, you just get the standard Explorer GAC view in the Open File dialog. It would be great if Reflector had an easy way to open an assembly from the GAC.
Comments
9 comments
-
I second that. I've had to copy them using command prompt to another directory to get them to open in Reflector.
-
there is a way... but it's really cumbersome and slow.
edit your reflector.cfg, and put in (or add to) a section like this:
[AssemblyCache]
"%SystemRoot%\Microsoft.net"
"%SystemRoot%\Assembly"
"%SystemRoot%\Assembly\GAC"
"%SystemRoot%\Assembly\GAC_MSIL"
"%ProgramFiles%\Microsoft.net"
"%ProgramFiles%\Reference Assemblies"
then when you do 'open cache', it will scan those folders for assemblies. the refresh process is very very slow, however, so i don't do it too often. -
deftflux wrote:I second that. I've had to copy them using command prompt to another directory to get them to open in Reflector.
So do I! And some GAC assemblies are missing (many Microsoft.VisualStudio.* dll for example). -
My Reflector.cfg file has the below settings and the Open Cache on the File menu seems to work fine for me ... what do you guys have?
[AssemblyCache]
"%SystemRoot%\Microsoft.net"
"%ProgramFiles%\Reference Assemblies"
"%ProgramFiles%\Microsoft.net"
"%ProgramFiles%\Microsoft Silverlight"
If you find the settings/directories you need to add, you could write an addin to update the reflector.cfg file pretty easy. -
Great, adding those directories to my .cfg and using Open Cache... did the trick.
It would be great if the default .cfg file including these directories.
Thanks. -
I've done this, but reflector doesn't see the assembly I'm looking for.
My asp.net web app is dying looking for CrystalDecisions.CrystalReports.Engine version 10.5.3700
I can see it in the GAC, but reflector doesn't? It is MSIL.
can someone explain what's going on? -
I'm pretty sure the Reflector doesn't actually search the whole 'GAC', but instead looks at only the directories (and subdirectories) you have listed in your .cfg file.
If you know the dll is in the MSIL cache add this to your cfg file under the [AssemblyCache] section:
"%WinDir%\Assembly\GAC_MSIL"
you could also try the other directories of
"%WinDir%\Assembly\GAC"
"%WinDir%\Assembly\GAC_32"
"%WinDir%\Assembly\GAC_64"
But I would try to get away with as few directories as possible under the [AssemblyCache] because it is a little slow. -
haleyjason,
I truly appreciate the input. I would also (really) appreciate a little background on what's going on.
I was under the impression that if an assembly is in the GAC it is available to all .NET processes on the system, this being the purpose of the GAC. I never really paid much attention to the "Process architecture" attribute displayed there. So I'm admitting my naivete in this area and asking for some explanation of what's happening under the covers.
If an assembly is in the GAC but showing as MSIL, does that affect the assembly's visibility system wide?
I explained what my ultimate goal is, this crystal assembly is in the GAC_MSIL and a web application is failing to fulfill it's reference to that dependency.
How should I proceed? -
Here are a couple of blog entries that will help you understand the different GAC folders (and when a dll is put in one versus the other ... as well as the probing order the clr uses to look in them):
http://blogs.msdn.com/junfeng/archive/2004/09/12/228635.aspx
http://blogs.msdn.com/junfeng/archive/2004/08/11/212555.aspx
When it comes to Reflector not finding the dll, you have to remember - it isn't the clr ... so no default probing of the GAC is done. Reflector is meant to be a flexible utility - so you (mostly) get to choose which version of the dll you want it to link to in Reflector. When running a .Net assembly the clr doesn't give you this option (without a config file anyways) ... it needs to have the probing rules so it can get the assembly running for you when you ask (Reflector doesn't - it is all static and flexible for the user ... Reflector only looks at the code it doesn't run it).
Hope this helps,
Jason
Add comment
Please sign in to leave a comment.