Click to See Complete Forum and Search --> : Add a dll to gac
dudu213
May 11th, 2005, 06:12 AM
I have a dll which I want to add to gac.
When I am opening the explorer and copying the dll to WINNT\Assembly folder it works ok and I see it in the gac.
But I need it to be part of my install shield - so I write an exe which copies the dll to gac - allthough the ::CopyFile returns success - I can't see the dll in the gac.
Krzemo
May 11th, 2005, 06:19 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfGlobalAssemblyCacheUtilityGacutilexe.asp
Best regards,
Krzemo.
darwen
May 11th, 2005, 06:20 AM
There's a utility with the .NET framework called gacutil.exe.
You need to run this with the -if flags e.g.
gacutil -if MyDll.dll
As a side note : you shouldn't be using the GAC unless you have a REALLY good reason to (e.g. if you've got an assembly which you're intending to call from native C++ via COM). All dlls should be installed in the same folder as the executable.
Darwen.
Anders
May 11th, 2005, 06:44 AM
I don't have InstallShield myself, but sources on the web imply that InstallShield has built in support for putting assemblies into the gac, much like the File System/Global Assembly Cache Folder in a Visual Studio setup project.
If my sources are lying :-) you have to go with the Krzemo-Darwen solution :-)
HTH!
dudu213
May 11th, 2005, 04:59 PM
Thanks all.
I have found that using the gacutil doe's the work for me - as for messing with gac.. I have to do that as my .net dll will be called from a vba.
MadHatter
May 11th, 2005, 06:32 PM
actually its windows installer that has the support for gac installation. since install shield does windows installer, it does it too. the installer that comes with vs.net has this ability also. click on the file system and select special folders, and you'll see the gac come up. select it and drag and drop your assemblies into that folder. the installer will install them into the gac.
if you're not using an installer gactuil is the way to go (drag and drop from windows explorer also works good).
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.