I need to create a small app or script to install a .NET assembly into the GAC. I\'ve read there are a couple ways to do this including:
gacutil.e
We recently had to do this for 10s of servers in an enterprise environment. We used Wix to build a very simple MSI (seriously - 5 minutes work) and published to all server (and dev boxes) through Group Policy.
I strongly recommend using existing methods (like the ones you mentioned) because they are both supported and maintained by Microsoft and will continue to work with future releases.
A quick look at gacutil.exe
with Process Monitor reveals that there is a little bit more to it than just copying files:
WINDOWS\assembly\GACLock.dat
, etc.)HKLM\SOFTWARE\Microsoft\Fusion\GACChangeNotification\...
)HKLM\SOFTWARE\Microsoft\Fusion\NativeImagesIndex...
)The wrapper in System.EnterpriseServices
is very similar to this old blog post and should work just fine.