George2
George2

Reputation: 45771

where is gacutil.exe?

I am using Windows 7 Enterprise 32 bit and .NET 3.5.

I have used Windows command line and also used VSTS 2008 command line,
but when executing gacutil.exe, there is a command not found error.

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)

Upvotes: 133

Views: 287180

Answers (5)

Jesse
Jesse

Reputation: 2599

You can use gacutil from inside of the "Developer Command Prompt for VS [your version year]". If you use it from there, it's part of the path, so no need to find its location.

Searching "Developer Command Prompt" from the search bar in Windows should pop it up as the first option.

Upvotes: 1

ritikaadit2
ritikaadit2

Reputation: 181

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.

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 this question.

Upvotes: 11

Andrey
Andrey

Reputation: 60065

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.exe included. But first check it here

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

you might have it installed.

As @devi mentioned

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

Upvotes: 165

nikita
nikita

Reputation: 2817

  1. Open Developer Command prompt.
  2. type

where gacutil

Upvotes: 90

Tiago Dias
Tiago Dias

Reputation: 585

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:

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.

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).

Upvotes: 6

Related Questions