In what scenarios should you use ServerContext over SPContext (and vice versa)? What advantages/disadvantages/limitations are presented? I can't seem to find a good deal of information on this.
+4
A:
From MSDN:
ServerContext Class (Microsoft.Office.Server) Provides run-time methods for shared services in Microsoft Office SharePoint Server 2007.
- First of all, as I can see, ServerContext is available only in MOSS.
- The example in mentioned MSDN site shows that to get shared services userprofiles, you need ServerContext.
Those are 2 different classes, not even inherited one by other. Can you use ServerContext to get current list item, list, web or site instance? Compare SPContext and ServerContext members and you'll find out the differences yourself.
Janis Veinbergs
2010-03-19 07:02:04