Groups | Blog | Home
all groups > dotnet framework > april 2007 >

dotnet framework : Add managed assemblies to GAC programmatically?


Jeff Johnson
4/19/2007 11:59:00 AM
Let's pretend I really really really don't like ClickOnce and I want to
implement my own updating process. Let's also say that I want the update
process to be able to add new assemblies to the GAC. Since gacutil.exe no
longer comes with the .NET framework by default, I can't simply shell out to
it, so I was wondering if there is a way to add assemblies to the GAC via
managed code.

Please note that I'm not talking about registering an assembly with COM or
COM+. I know there are things out there like the RegistrationServices class
and the System.EnterpriseServices namespace, but all the (admittedly few)
things I've read about them suggest that they're oriented towards COM/COM+.

Jeff Johnson
4/19/2007 1:46:16 PM
[quoted text, click to view]

Thanks. I hate to sound clueless, but this API is COM-based, yes? Would I
still be able to use it from a C# program? The sample code is C++.

Jeff Johnson
4/19/2007 2:35:14 PM
[quoted text, click to view]

Spectacular. Thanks.

Michael Nemtsev
4/19/2007 4:03:06 PM
Hello Jeff,

use GAC API, which is not documented http://support.microsoft.com/default.aspx?scid=kb;en-us;317540

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

JJ> Let's pretend I really really really don't like ClickOnce and I want
JJ> to implement my own updating process. Let's also say that I want the
JJ> update process to be able to add new assemblies to the GAC. Since
JJ> gacutil.exe no longer comes with the .NET framework by default, I
JJ> can't simply shell out to it, so I was wondering if there is a way
JJ> to add assemblies to the GAC via managed code.
JJ>
JJ> Please note that I'm not talking about registering an assembly with
JJ> COM or COM+. I know there are things out there like the
JJ> RegistrationServices class and the System.EnterpriseServices
JJ> namespace, but all the (admittedly few) things I've read about them
JJ> suggest that they're oriented towards COM/COM+.
JJ>

Rory Becker
4/19/2007 6:01:04 PM
[quoted text, click to view]

I'll be the first to admit I'd be a beginner in this area, but this link
looks like it might be of use
http://blogs.msdn.com/junfeng/articles/229649.aspx

--
Ror

AddThis Social Bookmark Button