Where can I find GACUtil?

怎甘沉沦 提交于 2020-12-30 05:46:38

问题


I know there have been many people asking the same thing, I have read all the posts related, but I couldn't find the gacutil.exe, I was looking at C:\WINDOWS\microsoft.net\Framework\v1.1.4322 and I found gacutil.exe.config but obviously it is just the config file. I need include a dll in the GAC.

this is a list from where I was looking the exe without any success:

  • C:\Program Files\Microsoft.NET
  • C:\WINDOWS\microsoft.net\Framework\v1.1.4322
  • C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin

Thanks in advance.


回答1:


You can find the GAC in any windows box under C:\windows\assembly\

or %windir%\assembly

GACUTIL -i filename registers the file with the GAC but doesn't necessarily locate the file inside the %windir%\assembly folder. This is a virtual folder controlled by SHFUSION.DLL which is a plugin windows explorer uses to display those files.

Further Reading Here

If you can't simply type GACUTIL /? from a cmd prompt. You can navigate in windows to the assembly sub folder of windows dir and drag/drop the dll inside that folder. You'll need to be an administrator of the pc to do this.

Typically to access this utility I fire up the VS 2010 Command Prompt as it has the appropriate %PATH% variable settings to locate the gacutil cmd.

On my box, I have 4 copies... First one is located here. C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64

The issue most likely is that you don't have the framework sdk for the 1.1 framework installed on the box you're trying to do this on. You can download that here




回答2:


You can run GACUtil using the Visual Studio Command Prompt. The Visual Studio Command Prompt is automatically installed with Visual Studio. To run the tool, use the Developer Command Prompt (or the Visual Studio Command Prompt in Windows 7). For more information, see Visual Studio Command Prompt.

In Windows 8.1 - On the Start screen, press CTRL + TAB to open the Apps list and then press V. The list will include all installed Visual Studio command prompts. (To open the Start screen, press the Windows logo key Windows logo on your keyboard.) Choose the Developer Command Prompt (or the command prompt you want to use).

In Windows 8 - On the Start screen, press the Windows logo key Windows logo + Z. (To open the Start screen, press the Windows logo key Windows logo on your keyboard.) Choose the Apps view icon at the bottom of the screen and then press V. The list will include all installed Visual Studio command prompts. Choose the Developer Command Prompt (or the command prompt you want to use).

In Windows 7 - Choose Start, expand All Programs, and then expand Microsoft Visual Studio. Depending on the version of Visual Studio you have installed, choose Visual Studio Tools, Visual Studio Command Prompt, or the command prompt you want to use.

GACUtil info: https://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.110).aspx

Example commands:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd C:\Windows\Microsoft.N et\assembly\GAC_MSIL\elite.eai.importsvc.generic.fm\v4.0_2.4.3.0__f659f54317ad7e 73\

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Elite.EAI.ImportSvc.Generic.FM\v4.0_2 .4.3.0__f659f54317ad7e73>gacutil.exe /i "elite.eai.importsvc.generic.fm.dll" Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved.

Assembly successfully added to the cache




回答3:


C:\Windows\assembly This is the GAC but it only references where the assemblies actually reside. Being visible hereonly indicates registration with the GAC.




回答4:


On Windows 2012 R2 Server, if you are not allowed to install Visual Studio or SDK,
you can use powershell to register assemblies into GAC. It didn't need any special installation for me.

Set-location "C:\Temp"
 [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
 $publish = New-Object System.EnterpriseServices.Internal.Publish
 $publish.GacInstall("C:\Temp\myGacLibrary.dll")



回答5:


If your is an enterprise application, you wouldn't have GacUtil on your Production box (assuming you are using Windows 2012 R2 or later). So, no point in using Gacutil to register assemblies into GAC. You can use GacInstall and GacRemove methods as listed in other answers using powershell. It worked for me. It just took some time to figure out the exact syntax.




回答6:


One simple way to get gacutil is to take it from a machine where it is already installed. You will need gacutil.exe and gacutil.exe.config from

C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\
(or analogous location)

and, gacutlrc.dll from the 1033 subdirectory.

Here, for example, is an archive with gacutil 4.0.30319.0 . It is a much leaner and simpler method of distribution than installing the huge Windows SDK with hundreds of files.



来源:https://stackoverflow.com/questions/9726035/where-can-i-find-gacutil

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!