Solved

Register DLL in GAC Programatically

Posted on 2010-09-23
5
891 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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