Thursday, August 25, 2011

Get DLL Out of The GAC

DLLs once deployed in GAC (normally located at c:\windows\assembly) can’t be viewed or used as a normal DLL file. They can’t be directly referenced from VS project. Developers usually keep a copy of the original DLL file and refer to it in the project at development (design) time, which uses the assembly from GAC during run-time of the project. During execution (run-time) if the assembly is found...Read more

Thursday, August 11, 2011

Add / Upload document to Document Library using SharePoint Object Model

Below is the code to upload document to SharePoint Document Library with all the metadata you wanted to update. String fileToUpload = @"C:\FileNamePath.txt"; String sharePointSite = "http://urSharePointsite.com/sites/"; String documentLibraryName = "Shared Documents"; using (SPSite oSite = new SPSite(sharePointSite)) {    using (SPWeb oWeb = oSite.OpenWeb())    {  ...Read more

Fetch user details based on user Alias/ Display Name and Update it to People or Group Field in List

The UserID relates to the ID of the user within the site collection. This is fine but the chances are that not all users are members of the site collection. To address this, the SharePoint OM has a handy little method called SPWeb.EnsureUser() which accepts a Login Name of a user as a string and first checks if the user exists in the site collection, if it does not then it adds the user...Read more

Wednesday, August 3, 2011

Define managed paths (SharePoint Server 2010)

Published: May 12, 2010 By defining managed paths, you can specify which paths in the URL namespace of a Web application are used for site collections. You can specify that one or more site collections exists at a specified path. This can be a convenient method of consolidating multiple site access for users in various departments. An explicitly named path (for example, http://server/sites/team)...Read more