.net gacutil.exe 在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3397479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
where is gacutil.exe?
提问by George2
I am using Windows 7 Enterprise 32 bit. I have used Windows command line, and also used VSTS 2008 command line, but when executing gacutil.exe, there is command not found error.
我使用的是 Windows 7 Enterprise 32 位。我使用过 Windows 命令行,也使用过 VSTS 2008 命令行,但是在执行 gacutil.exe 时,出现 command not found 错误。
I am wondering whether I need to install gacutil.exe from somewhere or gacutil.exe is located in somewhere else in my computer (I searched my computer, but find several files called gacutil.exe, I do not know which one should be used)?
我想知道我是否需要从某个地方安装gacutil.exe 或者gacutil.exe 位于我电脑的其他地方(我搜索了我的电脑,但找到了几个名为gacutil.exe的文件,我不知道应该使用哪个) ?
BTW: I am using .Net 3.5.
顺便说一句:我正在使用 .Net 3.5。
回答by Andrey
gacutil comes with Visual Studio, not with VSTS. It is part of Windows SDK and can be download separately at http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en. This installation will have gacutil.exeincluded. But first check it here
gacutil 随 Visual Studio 一起提供,而不是随 VSTS 一起提供。它是 Windows SDK 的一部分,可以在http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en单独下载。此安装将gacutil.exe包括在内。但首先在这里检查
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin
you might have it installed.
你可能已经安装了它。
As @devi mentioned
正如@devi 提到的
If you decide to grab gacutil files from existing installation, note that from .NET 4.0 is three files: gacutil.exe gacutil.exe.config and 1033/gacutlrc.dll
如果您决定从现有安装中获取 gacutil 文件,请注意 .NET 4.0 中的三个文件:gacutil.exe gacutil.exe.config 和 1033/gacutlrc.dll
回答by nikita
- Open Developer Command prompt.
- type
- 打开开发人员命令提示符。
- 类型
where gacutil
哪里gacutil
回答by Tiago Dias
You can use the version in Windows SDK but sometimes it might not be the same version of the .NET Framework your using, getting you the following error:
您可以在 Windows SDK 中使用该版本,但有时它可能与您使用的 .NET Framework 版本不同,从而出现以下错误:
Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.21022.8 Copyright (c) Microsoft Corporation. All rights reserved. Failure adding assembly to the cache: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Microsoft (R) .NET 全局程序集缓存实用程序。版本 3.5.21022.8 版权所有 (c) Microsoft Corporation。版权所有。将程序集添加到缓存失败:此程序集是由比当前加载的运行时更新的运行时构建的,无法加载。
In .NET 4.0 you'll need to search inside Microsoft SDK v8.0A, e.g.: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools (in my case I only have the 32 bit version installed by Visual Studio 2012).
在 .NET 4.0 中,您需要在 Microsoft SDK v8.0A 中搜索,例如:C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools(在我的情况下,我只有Visual Studio 2012 安装的 32 位版本)。
回答by ritikaadit2
On Windows 2012 R2, you can't install Visual Studio or SDK. You can use powershell to register assemblies into GAC. It didn't need any special installation for me.
在 Windows 2012 R2 上,您无法安装 Visual Studio 或 SDK。您可以使用 powershell 将程序集注册到 GAC。它对我来说不需要任何特殊安装。
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")
If you need to get the name and PublicKeyToken see thisquestion.
如果您需要获取名称和 PublicKeyToken,请参阅此问题。

