Sunday 28 September 2008

Where to find the Microsoft.Sharepoint.dll and other MOSS DLLs

If you're doing custom MOSS development on your local dev machine and deploying to a MOSS 2007 server environment, the relevant SharePoint DLLs should be referenced by your Visual Studio project. Since you haven't installed WSS/MOSS to your local environment, you need to copy those assemblies from the server. At a minimum, you'll probably need Microsoft.Sharepoint.dll.
Most DLLs will be located below C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\ISAPI. Alternatively--and for those DLLs not in the file system--you can extract all MOSS DLLs from the global assembly cache.

On your server, run the following command:

robocopy c:\windows\assembly\gac_msil c:\gac_extract /E

(replace robocopy with xcopy or download and install the Windows 2003 Resource Kit if you're not on Windows Server 2008)

The gac_extract folder will contain a hierarchical folder view of every assembly in your GAC; delve into the assembly folder you're after and copy across the DLL. To avoid keeping multiple copies of these DLLs in multiple projects, create a central local repository for the assemblies you require. Depending on the platforms you're targeting, you may want separate "referenced assemblies" repositories for RTM vs SP1 vs {your target combination of rollups and hotfixes}.

If you still can't find the assembly you're after, check \Inetpub\wwwroot\wss\VirtualDirectories\[site_name_or_port]\_app_bin

After adding a MOSS reference in VS, set the Copy Local property false. You can't run your MOSS project locally unless you're a Vista geek so there's no point copying the referenced assembly to your private bin folder--the assemblies are already installed on your server.
 

4 comments:

  1. Thank you so much. May Allah keep helping you for helping others.

    ReplyDelete
  2. Thank you so much. May Allah fold himself up into a ball and take everyone who constantly includes him in common language into the nothingness he came from.

    ReplyDelete
  3. Great, thank you very much ;)

    ReplyDelete

Spam comments will be deleted

Note: only a member of this blog may post a comment.