tags:

views:

137

answers:

1

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.

  1. First of all, as I can see, ServerContext is available only in MOSS.
  2. 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