How to install into the GAC?

0 votes
asked Nov 15, 2011 by andyl (140 points)
edited Nov 17, 2011

I am attempting to install the Rebex FTP components into my GAC for use in several applications, but it fails both from the command line and the .NET Configuration utility. I am following the instructions in the FAQ

Command line:

C:\Program Files\Rebex\File Transfer Pack for .NET 2.0\FTP SSL for .NET 2.0\bin>c:\windows\Microsoft.NET\Framework\v1.1.4322\gacutil.exe /i Rebex.Net.Ftp.dll

Microsoft (R) .NET Global Assembly Cache Utility.  Version 1.1.4318.0
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Failure adding assembly to the cache: Unknown Error

.NET Configuration utility (selecting the same DLL as above, Rebex.Net.Ftp.dll:

Cannot Add Assembly
Unable to add the selected assembly.  The assembly must have a strong name (name, version and public key).

Shouldn't the DLLs have a strong name provided by Rebex?

I understand I can distribute the DLLs with the rest of the application, etc. but for ease of deployment with multiple apps using the DLLs on one system I would much prefer to use the GAC. I'm a little surprised that this (registering the DLLs with the GAC) wasn't an option as part of the installation.

Where do I go from here to register with the GAC?

1 Answer

0 votes
answered Nov 16, 2011 by Lukas Matyska (57,550 points)
edited Nov 17, 2011

It is caused because you use gacutil.exe for .NET 1.1. Please use the gacutil.exe for .NET 2.0.

If you cannot find the gacutil.exe in the c:\windows\Microsoft.NET\Framework\v2.0.50727\ directory try the c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe directory instead.

Alternatively you can run the Start -> Programs -> Microsoft Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 Command Prompt and type:

gacutil.exe /i "C:\Program Files\Rebex\File Transfer Pack for .NET 2.0\FTP SSL for .NET 2.0\bin\Rebex.Net.Ftp.dll"
commented Nov 16, 2011 by andyl (140 points)
edited Nov 16, 2011

There is no gacutil.exe in c:\windows\Microsoft.NET\Framework\v2.0.50727\ and I will not have Visual Studio installed on the servers where my applications & scripts using the components need to run. Do I need to install the .NET Framework SDK on these systems? Or will this PowerShell script do the job?

commented Nov 16, 2011 by Lukas Matyska (57,550 points)
edited Nov 16, 2011

I am not familiar with the PoweShell, so I cannot tell. But it seems just copying the gacutil.exe and gacutil.exe.config to the server will do the work (see this post).

commented Nov 17, 2011 by andyl (140 points)
edited Nov 17, 2011

I read elsewhere that just copying gacutil wasn't advisable. The powershell script did the job and is more portable; I can just include instructions to run it from a shared drive as part of the install process.

I still believe it would be useful to have an option to install into the GAC during the main install process.