Can I download and install gacutil.exe without having to install VS or the SDK?
Asked Answered
H

4

31

I want an administrator to register some DLLs for me, but he would probably prefer not to install the whole SDK.

Can he just install gacutil.exe? If so, where can he get it? Do I just email the gacutil.exe file to him, and where does he have to put it on his machine to use it?

Haemophilia answered 6/4, 2011 at 20:25 Comment(4)
He can't. You can't redistribute it, forbidden by the license. Send him a quickie Setup.exe.Supposed
Thanks Hans. After continuing my research, I found that the official best practices way is to have a windows installer do it. So that is what I did, I created a simple setup project and all it does is install the assemblies to the GAC. Is this the correct way to do it? Any other suggestions/tips/gotchas?Haemophilia
Right, the quickie Setup.exe. Test it.Supposed
Yes, my next step is to test it on a virtual test box with the same setup as the production machine. If it works I will send it to the admin. Thanks Hans!Haemophilia
H
6

Per Hans' comment on my question, it's against the license. The best thing to do here is to create a quick setup.exe or msi which will install the files into the GAC, which I have done.

Haemophilia answered 11/4, 2011 at 5:2 Comment(0)
S
27

I got it working by copying gacutil.exe, gacutil.exe.config and gacutlrc.dll. I understand it's against the licence, but you can't get InstallShield in VisualStudio Express so this was the simplest solution.

Sing answered 10/7, 2014 at 14:11 Comment(0)
P
23

Old question, but in a pinch on a machine that doesn't have the SDK installed, as long as PowerShell is available you can do this:

#Note that you should be running PowerShell as an Administrator
[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:\Path\To\DLL.dll")

From https://www.andrewcbancroft.com/2015/12/16/using-powershell-to-install-a-dll-into-the-gac/

Pediatrician answered 5/4, 2017 at 14:28 Comment(3)
This worked for me. Sadly, it doesn't print any confirmation. It failed silently at first because my assembly was not strongly named (signed). Also, I used codeproject.com/Articles/430568/A-GAC-Manager-Utility-and-API to verify the installation and get the correct strong name.Intranuclear
Yes, it doesn't have any of those niceties that gacutil has :(Pediatrician
This works awesome yay!Sovran
H
6

Per Hans' comment on my question, it's against the license. The best thing to do here is to create a quick setup.exe or msi which will install the files into the GAC, which I have done.

Haemophilia answered 11/4, 2011 at 5:2 Comment(0)
R
2

Also an alternative is to just manually drag and drop the DLL into c:\windows\assembly.

For .net 4, I believe the assembly folder is c:\windows\microsoft.net\assembly - though I haven't tested a simple xcopy addition in this manner on .net 4.

Rosemonde answered 15/3, 2012 at 22:47 Comment(5)
You don't have to register it in the windows registry?Septuagint
@Septuagint Windows Registry not required in my testing ("Works on My Machine"™)Rosemonde
@Septuagint good data point of 1 to add to my data point of 1 - hence the "works on my machine" - probably wouldn't work if I had to try it again now 2 1/2 years later.Rosemonde
You can't drag 'n' drop .NET 4 files into the GAC. Tell me moreKarnak
@MickyDuncan - Thanks for the link. Looks like .net 4 indeed behaves differently than previous for GAC stuff.Rosemonde

© 2022 - 2024 — McMap. All rights reserved.