Solved

Register DLL in GAC Programatically

Posted on 2010-09-23
5
885 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:NCIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 33748808
Which flags are you passing to GACUTIL?
0
 
LVL 1

Author Comment

by:NCIT
ID: 33748925
workingdir: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
filename: gacutil
Args: -if "path to dll"
0
 
LVL 1

Author Comment

by:NCIT
ID: 33749204
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
0
 
LVL 1

Accepted Solution

by:
NCIT earned 0 total points
ID: 33754916
Solution was to add reference to System.EnterpriseServices and use the Internal.Publish() oject with the GacInstall method. Secondly, because of our requirements for dependant applications, we run a Diagnostics Process using the REGASM tool against the assembly.

This works like a charm and updates itself on the clients when we make DLL changes.
0
 
LVL 1

Author Comment

by:NCIT
ID: 33758054
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.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question