List Not Found exception by using .RootFolder.Name Property in SharePoint

3. July 2009

In SharePoint, if you use .RootFolder.Name property as shown below:

   1: string rootFolderName = objSPWeb.Lists[strListGuid].RootFolder.Name;

You might get exception on this IFF user changed that list name/title under question. Actually, RootFolder.Name doesn’t get changed once list is created. So, to make code flawless, you should use Title property of the list as shown below:

   1: string rootFolderName = objSPWeb.Lists[strListGuid].Title;

SharePoint

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading