Windows Server 2016 Gacutil

- Windows Server Versions
- Windows Server 2016 Download Iso
- Gacutil.exe Location Windows Server 2016
- Gacutil Location Windows Server 2016
- Qnap
- Microsoft Server 2016 Download Iso
- How to Install an Assembly in the GAC.; 2 minutes to read; In this article. Manually install and uninstall a BizTalk assembly in the global assembly cache (GAC) using the Gacutil tool included with Visual Studio. Using Visual Studio, you can have BizTalk assemblies automatically installed in the GAC when they are deployed from Visual.
- Prior to Windows Server 2012 I had been use to installing DLL files in the Windows Global Assembly Cache (GAC) by either opening the Windows/Assembly folder in Explorer and simply dragging and dropping the file, or by using GacUtil.exe With Windows Server 2012 unfortunately it’s not quite so easy.
Using Global Assembly Cache (GAC) Deployment Installing application components into the Global Assembly Cache (GAC) can be useful if you are installing components that will be used by multiple applications on the same machine, or if you need to run multiple versions of the same assembly on a single computer. Windows 2016 Server - Install.NET 4.7.1 - Install Win7 Dev Tools for Gacutil.EXE. Then, we are going to run the GACUTIL.EXE. How to enable.Net Framework 3.5 on Windows Server 2012 R2 (Step. I was trying to test our products to make sure that they are compatible with Windows Server 2016. And during some testing, I mistakenly thought that I can simply 'downgrade'.NET framework from 4.6. On Windows Server 2016 gacutil.exe is not available and in that case how do I register a custom dll into GAC on this? This tool is automatically installed with Visual Studio as per https://docs. The SSIS Script Task and Component can only reference assemblies from the Global Assembly Cache. If you have Visual Studio installed you can use GACUTIL to add the assembly to the GAC, but only if it's a strong named assembly.
I have created a Console Application With Adding External Dll Ref.
Now i have to deploy my External Dll to my Assembly.
When i was trying to add my dll in GAC.
command to add my dll into Assembly , Its showing me error
how can i fix?
Kaps HasijaKaps Hasija5 Answers
'But how can i deploy my dll on Client Server because he might don't have visual studio'
If I remember correctly, gacutil is also present in C:windowsMicrosoft.Netsome folder
Another way: If using a primitive .cmd => You could bundle gacutil.exe and gacutil.exe.config along with your script.
Yet another way: If you are using windows installer, that has in built support for GACing assemblies.
Also, note that there are different GACs for x86 and x64 assemblies (ignore if your assembly is MSIL).
For Windows 10 path is: C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin
probable duplicate : GAC 32bit vs. 64bit(gacutil is no more part of client OS since .Net 3.0 at least, you need to use a proper installer or to install the windows SDK which is clearly overkill)
Windows Server Versions
If you already installed Visual studio then you can use Developer Command Prompt instead of normal Command prompt
to access the gacutil
directly.
You can find Developer Command Prompt
here:
Start Menu > Visual Studio 20XX > Developer Command Prompt for VS20XX
Our Production Box running Windows Server 2016 does not have MS SDK tools for Global-Assembly cache (GAC)!!! So I copied the whole directory
from my Development laptop (Windows 10 that has VS 2017 installed) to that production server where I want to have my .dll's registered to my production server's Global Assembly.
Windows Server 2016 Download Iso
The assemblies I need to register are : _Net35scannersMonitor.dll which is x86 dotNet 2.0 and _Net40scannersMonitor.dll which is x64 dotNet 4.x.
At the prompt of directory where my copied gacUtil is, I entered:
and
I used the same gacUtil.exe (file version 4.6.1055.0) to do both. And they both end up at the right place dotnet2x86(C:Windowsassembly) and dotnet4(C:WindowsMicrosoft.NETassemblyGAC_MSIL) -- I don't have to use 2 different gacUtil.exe's.
Result:
Conclusion: Even your box has no VS installed, you can copy your gacutil.exe with its bin from the PC which has VS installed. No special download/install needed. Then you can use the copied gacutil for both x86 and x64 assemblies!!!
Not the answer you're looking for? Browse other questions tagged c#console or ask your own question.
-->The Global Assembly Cache tool allows you to view and manipulate the contents of the global assembly cache and download cache.
This tool is automatically installed with Visual Studio. To run the tool, use the Developer Command Prompt for Visual Studio (or the Visual Studio Command Prompt in Windows 7). For more information, see Command Prompts.
At the command prompt, type the following:
Syntax
Parameters
Argument | Description |
---|---|
assemblyName | The name of an assembly. You can supply either a partially specified assembly name such as myAssembly or a fully specified assembly name such as myAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0038abc9deabfle5 . |
assemblyPath | The name of a file that contains an assembly manifest. |
assemblyListFile | The path to an ANSI text file that lists assemblies to install or uninstall. To use a text file to install assemblies, specify the path to each assembly on a separate line in the file. The tool interprets relative paths, relative to the location of the assemblyListFile. To use a text file to uninstall assemblies, specify the fully qualified assembly name for each assembly on a separate line in the file. See the assemblyListFile contents examples later in this topic. |
Option | Description |
---|---|
/cdl | Deletes the contents of the download cache. |
/f | Specify this option with the /i or /il options to force an assembly to reinstall. If an assembly with the same name already exists in the global assembly cache, the tool overwrites it. |
/h[elp] | Displays command syntax and options for the tool. |
/iassemblyPath | Installs an assembly into the global assembly cache. |
/ifassemblyPath | Installs an assembly into the global assembly cache. If an assembly with the same name already exists in the global assembly cache, the tool overwrites it. Specifying this option is equivalent to specifying the /i and /f options together. |
/ilassemblyListFile | Installs one or more assemblies specified in assemblyListFile into the global assembly cache. |
/irassemblyPath scheme id description | Installs an assembly into the global assembly cache and adds a reference to count the assembly. You must specify the assemblyPath, scheme, id,and description parameters with this option. For a description of the valid values you can specify for these parameters, see the /r option. Specifying this option is equivalent to specifying the /i and /r options together. |
/l [assemblyName] | Lists the contents of the global assembly cache. If you specify the assemblyName parameter, the tool lists only the assemblies matching that name. |
/ldl | Lists the contents of the downloaded files cache. |
/lr [assemblyName] | Lists all assemblies and their corresponding reference counts. If you specify the assemblyName parameter, the tool lists only the assemblies matching that name and their corresponding reference counts. |
/nologo | Suppresses the Microsoft startup banner display. |
/r [assemblyName assemblyPath] scheme id description | Specifies a traced reference to an assembly or assemblies to install or uninstall. Specify this option with the /i, /il, /u, or /ul options. To install an assembly, specify the assemblyPath, scheme, id,and description parameters with this option. To uninstall an assembly, specify the assemblyName, scheme, id,and description parameters. To remove a reference to an assembly, you must specify the same scheme, id, and description parameters that were specified with the /i and /r (or /ir) options when the assembly was installed. If you are uninstalling an assembly, the tool also removes the assembly from the global assembly cache if it is the last reference to remove and if Windows Installer has no outstanding references to the assembly. The scheme parameter specifies the type of installation scheme. You can specify one of the following values: - UNINSTALL_KEY: Specify this value if the installer adds the application to Add/Remove Programs in Microsoft Windows. Applications add themselves to Add/Remove Programs by adding a registry key to HKLMSoftwareMicrosoftWindowsCurrentVersion. - FILEPATH: Specify this value if the installer does not add the application to Add/Remove Programs. - OPAQUE: Specify this value if supplying a registry key or file path does not apply to your installation scenario. This value allows you to specify custom information for the id parameter. The value to specify for the id parameter depends on the value specified for the scheme parameter: - If you specify UNINSTALL_KEY for the scheme parameter, specify the name of the application set in the HKLMSoftwareMicrosoftWindowsCurrentVersion registry key. For example, if the registry key is HKLMSoftwareMicrosoftWindowsCurrentVersionMyApp, specify MyApp for the id parameter. - If you specify FILEPATH for the scheme parameter, specify the full path to the executable file that installs the assembly as the id parameter. - If you specify OPAQUE for the scheme parameter, you can supply any piece of data as the id parameter. The data you specify must be enclosed in quotation marks ('). The description parameter allows you to specify descriptive text about the application to install. This information is displayed when references are enumerated. |
/silent | Suppresses the display of all output. |
/uassemblyName | Uninstalls an assembly from the global assembly cache. |
/ufassemblyName | Forces a specified assembly to uninstall by removing all references to the assembly. Specifying this option is equivalent to specifying the /u and /f options together. Note: You cannot use this option to remove an assembly that was installed using Microsoft Windows Installer. If you attempt this operation, the tool displays an error message. |
/ulassemblyListFile | Uninstalls one or more assemblies specified in assemblyListFile from the global assembly cache. |
/u[ngen] assemblyName | Uninstalls a specified assembly from the global assembly cache. If the specified assembly has existing reference counts, the tool displays the reference counts and does not remove the assembly from the global assembly cache. Note: In the .NET Framework version 2.0, /ungen is not supported. Instead, use the uninstall command of the Ngen.exe (Native Image Generator). In the .NET Framework versions 1.0 and 1.1, specifying /ungen causes Gacutil.exe to remove the assembly from the native image cache. This cache stores the native images for assemblies that have been created using the Ngen.exe (Native Image Generator). |
/urassemblyName scheme id description | Uninstalls a reference to a specified assembly from the global assembly cache. To remove a reference to an assembly, you must specify the same scheme, id, and description parameters that were specified with the /i and /r (or /ir) options when the assembly was installed. For a description of the valid values you can specify for these parameters, see the /r option. Specifying this option is equivalent to specifying the /u and /r options together. |
/? | Displays command syntax and options for the tool. |
Remarks
Note
You must have administrator privileges to use Gacutil.exe.
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. You can use Gacutil.exe to install two applications that install the same assembly; the tool keeps track of the number of references to the assembly. As a result, the assembly will remain on the computer until both applications are uninstalled. If you are using Gacutil.exe for actual product installations, use the options that support reference counting. Use the /i and /r options together to install an assembly and add a reference to count it. Use the /u and /r options together to remove a reference count for an assembly. Be aware that using the /i and /u options alone does not support reference counting. These options are appropriate for use during product development but not for actual product installations.
Use the /il or /ul options to install or uninstall a list of assemblies stored in an ANSI text file. The contents of the text file must be formatted correctly. To use a text file to install assemblies, specify the path to each assembly on a separate line in the file. The following example demonstrates the contents of a file containing assemblies to install.
To use a text file to uninstall assemblies, specify the fully qualified assembly name for each assembly on a separate line in the file. The following example demonstrates the contents of a file containing assemblies to uninstall.
Note
Attempting to install an assembly with a filename longer than between 79 and 91 characters (excluding the file extension) can result in the following error:
This is because internally Gacutil.exe constructs a path of up to MAX_PATH characters that consists of the following elements:
- GAC Root - 34 chars (ie.
C:WindowsMicrosoft.NETassembly
) - Architecture - 7 or 9 chars (ie.
GAC_32
,GAC_64
,GAC_MSIL
) - AssemblyName - Up to 91 chars, depending on the size of the other elements (eg.
System.Xml.Linq
) - AssemblyInfo - 31 to 48 chars or more consisting of:
- Framework - 5 chars (eg.
v4.0_
) - AssemblyVersion - 8 to 24 chars (eg.
9.0.1000.0_
) - AssemblyLanguage - 1 to 8 chars (eg.
de_
,sr-Cyrl_
) - PublicKey - 17 chars (eg.
31bf3856ad364e35
)
- Framework - 5 chars (eg.
- DllFileName - Up to 91 + 4 chars (ie.
<AssemblyName>.dll
)
Examples
The following command installs the assembly mydll.dll
into the global assembly cache.
The following command removes the assembly hello
from the global assembly cache as long as no reference counts exist for the assembly.
Note that the previous command might remove more than one assembly from the assembly cache because the assembly name is not fully specified. For example, if both version 1.0.0.0 and 3.2.2.1 of hello
are installed in the cache, the command gacutil /u hello
removes both of the assemblies.
Gacutil.exe Location Windows Server 2016
Use the following example to avoid removing more than one assembly. This command removes only the hello
assembly that matches the fully specified version number, culture, and public key.
The following command installs the assemblies specified in the file assemblyList.txt
into the global assembly cache.
Mugen game download for pc. The following command removes the assemblies specified in the file assemblyList.txt
from the global assembly cache.
The following command installs myDll.dll
into the global assembly cache and adds a reference to count it. The assembly myDll.dll
is used by the application MyApp
. The UNINSTALL_KEY MyApp
parameter specifies the registry key that adds MyApp
to Add/Remove Programs in Windows. The description parameter is specified as My Application Description
.
Gacutil Location Windows Server 2016
The following command installs myDll.dll
into the global assembly cache and adds a reference to count it. The scheme parameter, FILEPATH
, and the id parameter, c:applicationsmyAppmyApp.exe
, specify the path to the application that is installing myDll.dll.
The description parameter is specified as MyApp
.
The following command installs myDll.dll
into the global assembly cache and adds a reference to count it. The scheme parameter, OPAQUE
, allows you to customize the id and description parameters.
The following command removes the reference to myDll.dll
by the application myApp
. If this is the last reference to the assembly, it will also remove the assembly from the global assembly cache.
Qnap
The following command lists the contents of the global assembly cache.