Adding/Updating assemblies in GAC during runtime and not during Se

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there an API or suggested technique by which I can add/update assemblies
to the GAC during the runtime of my application instead of exclusively during
the Setup of the application. I would like to be able to update some
libraries without having to completely reinstall the application.
 
The API for the GAC is named "Fusion" and initially was not documented. Now
you can see:

DOC: Global Assembly Cache (GAC) APIs Are Not Documented in the .NET
Framework Software Development Kit (SDK) Documentation
http://support.microsoft.com/default.aspx?scid=kb;en-us;317540

Maybe an easier way is to use gacutil.exe -i <myassembly> from code.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
I'd be willing to try to run gacutil.exe from code. I assume that this will
only work if the assemblies are not currently being used/loaded.

In VB, how does one start an .exe from code(including use of command line
switches), assuming the .exe is in the application folder?

Michael
 
Hi Michael,

Based on my understanding, you want to know how to use the Gacutil.exe to
install an assembly into the GAC through code.

Does your "VB" mean VB.net?
In .Net, we may use System.Diagnostics.Process.Start method to run
Gacutil.exe and install an assembly into the GAC.

For more information about the usage of Gacutil.exe, please refer to:
"Global Assembly Cache Tool (Gacutil.exe)"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfglobalassemblycacheutilitygacutilexe.asp

If I misunderstand you, please feel free to tell me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Yes, I'm in .NET. I will look at System.Diagnostics.Process.Start to run
gacutil.exe from within my code. Thanks.

I assume that 2 assemblies can have the same exact name and differ only by
version number. I'll have to be careful with the gacutil and use fully
qualified names when making changes to the GAC.

Michael
 
Hi Michael,

Yes, we can only install strong-named assembly into the GAC. Anyway, if you
need any further help, please feel free to tell me, I will help you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top