With a lot of emphasis on unit testing during development, developers sometimes spend time in bursts for deploying assemblies to GAC. The spent time though insignificant in bursts becomes considerable when considered cumulatively as a percentage of the total deployment time during development.
Enjoy!!
Following are a couple of ways to deploy assemblies to GAC on the fly and save that little percentage:
(1) Right Click and Deploy
How cool would it be to have an option of right clicking an assembly and deploying it to GAC. Really cool hey!
To do this Open your registry and add a key “HKEY_CLASSES_ROOT\dllfile\shell\Add to GAC\command” and set its value to "D:\\Program Files (x86)\\Microsoft Visual Studio 8\\SDK\\v2.0\\Bin\\gacutil.exe" /i "%1".
Refresh and voila you get an option on right click to add the assemblies to GAC
(2) Post Build Event
I have been a big fan of post build events and have been using it to do move files around.
One of my favourites is obviously the one that GACs the assemblies.
Include the following script in the post build event to GAC your assemblies:
echo "Installing assembly to GAC"
"$(DevEnvDir)..\..\SDK\v2.0\Bin\GacUtil.exe" /i "$(TargetPath)" /f