Open class library project properties > Build events and add this script in post-build command line :
|
"$(DevEnvDir)..\..\SDK\v2.0\Bin\gacutil.exe" /u $(TargetName)
rem IF NOT $(ConfigurationName) == Release GOTO end
:: Copying assembly to the GAC
echo Copying assembly to the GAC
"$(DevEnvDir)..\..\SDK\v2.0\Bin\gacutil.exe" /i "$(TargetPath)"
:end
echo Finished Post Build Event
|
The path could be different (bold text). You may have to change it by something like
C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\gacutil.exe
(…and v2.0 by v1.1 for an older framework version….)
or
C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\gacutil.exe
(for the recent Windows SDK Win32+.NET 3.0)