Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Register DLL in GAC Programatically

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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…
Suggested Courses

604 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