?
Solved

Register DLL in GAC Programatically

Posted on 2010-09-23
5
Medium Priority
?
904 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

771 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