How can I get the GAC location using C #?

How can I get the location of a GAC directory using C #?

Is there an entry in the Windows registry?

UPDATE

I need a place because I want to list and analyze the assemblies located in the GAC.

Bye

+3
source share
5 answers

If you want to list material in the GAC (for example, write a tool for system administration), the best option is to use the fusion.dll file, although this requires some kind of interaction code on your side.

Microsoft Documentation Link for Fusion.DLL

+5
source

Isn't that always the case %windir%\assembly?

edit:

c:\Windows>dir \windows\assembly
 Volume in drive C has no label.
 Volume Serial Number is C8BC-2EBD

 Directory of c:\windows\assembly

08/14/2009  03:06 AM    <DIR>          GAC
07/28/2009  03:07 AM    <DIR>          GAC_32
09/08/2009  10:57 PM    <DIR>          GAC_MSIL
08/15/2009  07:35 PM    <DIR>          NativeImages_v2.0.50727_32
09/08/2009  10:57 PM    <DIR>          temp
09/08/2009  09:47 PM    <DIR>          tmp
               0 File(s)              0 bytes
               6 Dir(s)   4,560,822,272 bytes free
+1

% windir%\Assembly.

, .

+1

GAC , . , , . , .

% windir%\assembly, , . GACView.

, , : / . . Windows XP, Windows 7 64 Bit, 32- . Windows 7 64 Bit, Regedit (64 ),

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

DWORD DisableCacheViewer 1.

( ), Fusion:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\GACChangeNotification\Default

, GACView . .NET 4 % windir%\Microsoft.NET\assembly.

, .NET 4, GACBrowser, .

+1
source

Let the runtime manage its assemblies and hope that they are there. If you need to install something, use gacutil. If you need to remove something, use gacutil. If you need to access the assembly, add a link to it in your project. If you need to interact with the GAC on someone else’s machine, do what @Dan says and uses MSI and friends.

Otherwise DO NOT SAY GAC

0
source

Source: https://habr.com/ru/post/1719928/


All Articles