Mono(gacutil)

✨ gacutil ✨

okay bestie, welcome to the Mono manual page for gacutil πŸ’… this is your girl explaining the Global Assembly Cache tool like we're texting at 2am, but every single detail is staying put, no cap 🫢


πŸŽ€ NAME πŸŽ€

gacutil β€” the Global Assembly Cache management utility, aka your new bestie for wrangling assemblies πŸ¦‹


🌸 SYNOPSIS 🌸

gacutil [-user] [command] [options]

πŸ’– DESCRIPTION πŸ’–

so like, gacutil is a tool that devs use to install versioned assemblies into the system Global Assembly Cache (GAC) so they become part of the assemblies that are available for all applications at runtime. main character energy fr fr πŸ‘‘

⚠️ heads up though: notice that they are not directly available to the compiler. the convention is that assemblies must also be placed in a separate directory to be accessed by the compiler. this is done with the -package directive to gacutil. iykyk 😭

the tool lets you do three iconic things: installation, removal, and listing of the contents of the assembly cache. slay.

and the GAC is relative to the Mono installation prefix: mono_prefix/lib/mono 🌈


πŸ’… COMMANDS πŸ’…

  • -i <assembly_path> [-check_refs] [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] β€” installs an assembly into the global assembly cache. <assembly_path> is the name of the file that contains the assembly manifest ✨

the -package option can be used to also create a directory in in prefix/lib/mono with the name NAME, and a symlink is created from NAME/assembly_name to the assembly on the GAC. this is used so developers can reference a set of libraries at once πŸŽ€

the -root option is used to specify the "libdir" value of an installation prefix which differs from the prefix of the system GAC. typical automake usage is -root $(DESTDIR)$(prefix)/lib. to access assemblies installed to a prefix other than the mono prefix, it is necessary to set the MONO_GAC_PREFIX environment variable 🌸

the -gacdir option is included for backward compatibility but is not recommended for new code. use the -root option instead πŸ™ˆ

the -check_refs option is used to ensure that the assembly being installed into the GAC does not reference any non strong named assemblies. assemblies being installed to the GAC should not reference non strong named assemblies, however the is an optional check πŸ’œ

  • -l [assembly_name] [-root ROOTDIR] [-gacdir GACDIR] β€” lists the contents of the global assembly cache. when the <assembly_name> parameter is specified only matching assemblies are listed πŸ‘‘
  • -u <assembly_display_name> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] β€” uninstalls an assembly from the global assembly cache. <assembly_display_name> is the name of the assembly (partial or fully qualified) to remove from the global assembly cache. if a partial name is specified all matching assemblies will be uninstalled. as opposed to the install option that takes a filename, this takes as an argument the assembly name, which looks like this:
MyLibrary.Something, version=1.0.0.0, publicKeyToken=xxxx,culture=neutral

notice that you can have spaces in the command line. there is no need to quote them 🫢

performs a greedy removal. if you only specify one component like, "MyLibrary.Something", it will remove all versions of the library πŸ’€

  • -us <assembly_path> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] β€” uninstalls an assembly using the specified assembly's full name. <assembly path> is the path to an assembly. the full assembly name is retrieved from the specified assembly; if there is an assembly in the GAC with a matching name, it is removed. unlike the -u option this option takes a file name, like this:
Example: -us myDll.dll
  • -ul <assembly_list_file> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR] β€” uninstalls one or more assemblies from the global assembly cache. <assembly_list_file> is the path to a test file containing a list of assembly names on separate lines. example -ul assembly_list.txt

assembly_list.txt contents:

assembly1,Version=1.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
assembly2,Version=2.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef

πŸ¦‹ FILES πŸ¦‹

on Unix, assemblies are loaded from the installation lib directory. if you set prefix to /usr, the assemblies will be located in /usr/lib. on Windows, the assemblies are loaded from the directory where mono and mint live 🧚

  • /etc/mono/config, ~/.mono/config

Mono runtime configuration file. see the mono-config(5) manual page for more information πŸ’œ


🌈 WEB SITE 🌈

visit: http://www.go-mono.com for details ⭐


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page bestie, you ate that πŸ’…πŸ’– this was the Mono(gacutil) manual page, brought to you by the Mono crew β€” go forth and install those assemblies, you've got this πŸ‘‘βœ¨

πŸ“¦ where this page comes from