Gacutil Location Windows 10

-->

Oct 21, 2015  The application server has the.NET redistributable installed, but it does not have the.NET SDK installed, therefore this folder did not exist on the server, and there was no gacutil.exe. One solution is to download and install the Microsoft Windows SDK for Windows 7 and.NET Framework 4. There will be a separate version of the gacutil.exe in the system for each version of.NET. I am using gacutil.exe for.NET framework 4.0 and we are passing a “-i” parameter to install the assembly in the GAC. To unregister the parameter will be “-u”. Now, once registered successfully, we will find the assembly in the following location. Jan 09, 2011  Latest gacutil is part of Microsoft Windows SDK for Windows 7 and.NET Framework 4. Remember you can’t use previews version of gacutil (1.1 or 2.0/3.5) to register dll built in framework 4.0. If you don’t want to install whole SDK you need to copy. Mar 30, 2017  Specifically, Gacutil.exe allows you to install assemblies into the cache, remove them from the cache, and list the contents of the cache. Gacutil.exe provides options that support reference counting similar to the reference counting scheme supported by Windows Installer.

Each computer where the Common Language Runtime is installed has a machine-wide code cache called the Global Assembly Cache. The Global Assembly Cache stores assemblies specifically designated to be shared by several applications on the computer.

You should share assemblies by installing them into the Global Assembly Cache only when you need to. As a general guideline, keep assembly dependencies private, and locate assemblies in the application directory unless sharing an assembly is explicitly required. In addition, it is not necessary to install assemblies into the Global Assembly Cache to make them accessible to COM interop or unmanaged code.

Where Is Gacutil

Note

There are scenarios where you explicitly do not want to install an assembly into the Global Assembly Cache. If you place one of the assemblies that make up an application in the Global Assembly Cache, you can no longer replicate or install the application by using the xcopy command to copy the application directory. You must move the assembly in the Global Assembly Cache as well.

There are two ways to deploy an assembly into the Global Assembly Cache:

  • Use an installer designed to work with the Global Assembly Cache. This is the preferred option for installing assemblies into the Global Assembly Cache.

  • Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the Windows SDK.

    Note

    In deployment scenarios, use Windows Installer to install assemblies into the Global Assembly Cache. Use the Global Assembly Cache tool only in development scenarios, because it does not provide assembly reference counting and other features provided when using the Windows Installer.

Starting with the .NET Framework 4, the default location for the Global Assembly Cache is %windir%Microsoft.NETassembly. In earlier versions of the .NET Framework, the default location is %windir%assembly.

Administrators often protect the systemroot directory using an access control list (ACL) to control write and execute access. Because the Global Assembly Cache is installed in a subdirectory of the systemroot directory, it inherits that directory's ACL. It is recommended that only users with Administrator privileges be allowed to delete files from the Global Assembly Cache.

Download

Assemblies deployed in the Global Assembly Cache must have a strong name. When an assembly is added to the Global Assembly Cache, integrity checks are performed on all files that make up the assembly. The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change.

See also

21 Oct 2015CPOL
This article outlines the steps for installing the Global Assembly Cache Tool on Windows Server 2008.

Problem

I have a customer using Windows Server 2008 for hosting its ASP.NET web applications. The operating environment on the server is kept very clean and lightweight, so only the bare necessities are installed. For example, there are no office productivity tools (like Office) or integrated development tools (like Visual Studio) installed in these environments. This is definitely a good practice; it keeps the potential attack surface small, and it helps to ensure that the server runs as fast as possible, without any potential for bogging down due to unnecessary programs or processes.

All of the web applications on this particular server rely on a Microsoft.NET assembly from a third-party software component vendor. The assembly DLL file is over 14 MB, which is relatively large, so we decided to move the DLL into the Global Assembly Cache (GAC) so it can be shared by all applications. Previously, a copy of the DLL was installed in the bin directory for every application that used it. This was wasteful of resources, and more difficult to maintain when the vendor released updates to the assembly.

You will recall the global assembly cache is machine-wide code cache that stores assemblies that are specifically intended for sharing by several applications on the computer. The Global Assembly Cache Tool (gacutil.exe) allows you to install assemblies into the cache, remove them from the cache, and list the contents of the cache. Using the tool to install an assembly into the cache is simple:

However, the gacutil executable did not exist anywhere on the server.

According to Microsoft, gacutil.exe is considered to be a development tool. Because of this, it is contained in the .NET SDK and not in the .NET redistributable. Visual Studio comes with the SDK, so if you have Visual Studio installed, then this tool is installed with it. For example, on my development machine, the executable file is located here:

The application server has the .NET redistributable installed, but it does not have the .NET SDK installed, therefore this folder did not exist on the server, and there was no gacutil.exe.

Gacutil Path Windows 10

Solution

One solution is to download and install the Microsoft Windows SDK for Windows 7 and .NET Framework 4. Version 7.1, published on May 19 of 2010, is available for free download here:

After downloading winsdk_web.exe, you can run the program with administrator permissions, and select the .NET Installation Options.

The installation takes a few minutes to run, and after it completes, the Global Assembly Cache Tool is ready to use.

I found this to be the simplest solution, although there are alternatives for adding assemblies to the GAC without installing the .NET SDK and without using gacutil.exe at all:

Gacutil Download Microsoft

  • If you have developed the application yourself, you can use the GacInstall method. For more information, refer to the class documentation for System.EnterpriseServices.Internal.Publish.
  • Create a PowerShell script that wraps the Publish.GacInstall function. Here is one example.
  • Create a Microsoft Installer (MSI) package to deploy the assembly. Microsoft provides help documentation for this, and instructive tutorials are also available.