Hi All,
I'm using the following code to get personal social feed,
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(serverURL))
{
SPServiceContext serviceContext = SPServiceContext.GetContext(site);
SPSocialFeedOptions feedOptions = new SPSocialFeedOptions();
feedOptions.MaxThreadCount = 10;
SPSocialFeed everyoneFeed = feedManager.GetFeed(SPSocialFeedType.Personal, feedOptions);
}
}
but exceptions are thrown:
SPSocialFeedManager.GetFeed: Exception: Microsoft.Office.Server.Microfeed.MicrofeedException: ServerErrorFetchingActivityFeed : ( Value cannot be null. Parameter name: serviceContext ) : Correlation ID:00000000-0000-0000-0000-000000000000 : Date and Time : 1/30/2013 7:54:39 PM
at Microsoft.Office.Server.Microfeed.SPMicrofeedThreadCollection.AddActivityEventsToThreadCollection(SPMicrofeedRetrievalOptions retOptions)
at Microsoft.Office.Server.Microfeed.SPMicrofeedThreadCollection.Populate(SPMicrofeedRetrievalOptions retrievalOptions, SPMicrofeedContext context)
at Microsoft.Office.Server.Microfeed.SPMicrofeedManager.CommonGetFeedFor(SPMicrofeedRetrievalOptions retrievalOptions)
at Microsoft.Office.Server.Microfeed.SPMicrofeedManager.CommonPubFeedGetter(SPMicrofeedRetrievalOptions feedOptions, MicrofeedPublishedFeedType feedType, Boolean publicView)
at Microsoft.Office.Server.Microfeed.SPMicrofeedManager.GetMyPublishedFeed(SPMicrofeedRetrievalOptions feedOptions, MicrofeedPublishedFeedType typeOfPubFeed, Boolean ShowPublicView)
at Microsoft.Office.Server.Social.SPSocialFeedManager.Microsoft.Office.Server.Social.ISocialFeedManagerProxy.ProxyGetFeed(SPSocialFeedType type, SPSocialFeedOptions options)
at Microsoft.Office.Server.Social.SPSocialFeedManager.<>c__DisplayClass4b`1.<S2SInvoke>b__4a()
However, I can successfully get every social feed by changing the first parameter in GetFeed() from Personal to Everyone.
How can I fix this?
Thanks,