Tuesday, December 4, 2007

Easy add .dll to GAC

Often in Sharepoint you’ll need to add assemblies to the Global Assembly Cache. An easy way is creating a registry key which allows you to right click the DLL and add to the GAC in one click.

Simply copy and paste the script below into notepad and save it as a registry file (.reg extension). Then double click the file to exceute and it will then be added it to the registry.

.Net 1.1
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]
@="c:\\windows\\Microsoft.NET\\Framework\\v1.1.4322\\gacutil.exe /i \"%1\""

.Net 2.0
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\shell\gacutil\command]
@="C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\V2.0\\Bin\\gacutil.exe /i \"%1\""



See: http://amit-rohilla.spaces.live.com/blog/cns!2CEC2165026E6288!158.entry

Monday, December 3, 2007

Wednesday, November 21, 2007

Access stsadm.exe utility from any directory

For alot of SharePoint administration you have to use the STSADM.EXE command line utility which can be found in the SharePoint Hive (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN). To run it, you have to navigate to that directory which can be quite painful when you need to access it over & over again (unless you have setup some shortcuts to this folder).
However, I have found a tip today that eradicates the need to type out the navigation path, by adding the directory to the PATH environment variable, you are able to use this utility from any directory.

Here goes:

1)Go to Start -> All Programs -> Control Panel -> System
2) On the Advanced tab, click the Environment Variables button. Select the "Path" variable and click the Edit button.

3)Add the following to the end of the Variable value field: ;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN (don't forget the semicolon... the Path environment variable is a semicolon delimited string of directories)
4) Click OK.
You may have to restart after this & from here on you will be typing less as you can use the stsadm.exe from any direcory path :)