Link to home
Start Free TrialLog in
Avatar of NCIT
NCIT

asked on

Register DLL in GAC Programatically

How can we install a DLL into the GAC Assembly programatically through either a process or file action via visual studio VB 2008? We have tried many ways and need your help!

The process runs on startup within a distributed windows forms application. We would like to overwrite the DLL if it already exists at this point.

Basically the only way we get it to install is by dragging it into the windows assembly folder manually. The .NET gacutil on the clients results in "Unknown Error" always.
Avatar of kaufmed
kaufmed
Flag of United States of America image

Which flags are you passing to GACUTIL?
Avatar of NCIT
NCIT

ASKER

workingdir: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
filename: gacutil
Args: -if "path to dll"
Avatar of NCIT

ASKER

Sorry I meant this working directory on the client (.net 3.5 is required by the installer for the client application):
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

Also fyi, our DLL and application are both tageting .net 3.5

Just using the   -if   flag
ASKER CERTIFIED SOLUTION
Avatar of NCIT
NCIT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NCIT

ASKER

Following up incase others have this issue. We switched from using Process > REGASM to using Assembly / RegistrationServices class. When users had .net 4 installed it was failing with REGASM. I think this is a better solution than running the command line tool.