Friday, February 27, 2009

How To Find Microsoft.SharePoint.*.Dlls

There are a bunch of reasons for wanting to get to the SharePoint dlls, whether you're a developer wanting to better understand how SharePoint works, you're wanting to develop and compile code on your client machine instead of a server (against Microsofts recommendation), or if you're wanting to explore the DLLs using .Net Reflector.
Most of them are in the ../12/ISAPI Folder, including:
Microsoft.SharePoint.dll
Microsoft.SharePoint.Search.dll
Microsoft.SharePoint.Security.xml
Microsoft.SharePoint.WorkflowActions.dll
And of the MOSS equivalents

However, not all of them are there.

Microsoft.SharePoint.ApplicationPages.dll is in the c:\inetpub\..\_app_bin folder.

Most of the others, such as Microsoft.SharePoint.Library.dll, are in the GAC.

So how do you reference these dlls using Visual Studio or Reflector? copy them out. Easier said than done, however.

Though you can browse to the GAC using explorer view, you can't copy Dlls out. You'll have to do it through the command prompt.

First, go to c:\windows.
then type in xcopy assembly c:\copylocation /e

This will copy out all of the DLLs into c:\copylocation. When you browse to this folder, you'll see a few different folders. GAC, GAC_32 and GAC_64 if you're using 64-bit OS, GAC_MSIL and a few others. Search will be in the GAc_64 folder, but the rest will be in GAC_MSIL (such as AdministrationOperation, Diagnostics, Dsp, Library, Publishing, etc).

Now you can use these Dlls in Reflector or VS! yay!

1 comment:

  1. This is great I've been trying to get a way to have easy accessibility to the dll's that I need on the fly. Thanks...

    ReplyDelete