Things you assumed about the Sharepoint API

Indexers throw ArgumentException

You might have thought that calling SPSite.AllWebs["someURI"] returned null if the element was not found. This one actually throws an ArgumentException, something you would expect from a GetStuff(arg) method:

[ArgumentException: Value does not fall within the expected range.]
   Microsoft.SharePoint.SPWebCollection.get_Item(String name)

1 Comment

  • I want to creat a utility that can create an "site group" in our share point at the time of its instalation. which api of the sharepoint should i use for that

Comments have been disabled for this content.