Sharepoint 2010 - issue creating an activity news feed

Wow this is rough...I dont see much on the net ...the samples I do...dont work very well...

I am using this link:
http://blogs.microsoft.co.il/johnnyt/2011/03/26/working-with-sharepoint-2010-user-activity-newsfeed/


to create an activity newsfeed...everything isd working fine..however the issue I am having is that SPServiceContext and SPContext do not work inside event handlers like the an event reciever ...FeaturedActivated...any ideas?
LVL 10
GlobaLevelProgrammerAsked:
Who is Participating?
 
Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
I have seen issues with the SPContext and SPServiceContext when the Alternate Access Mapping isn't set correctly.  Especially if someone has been changing the host header mappings in IIS.
0
 
GlobaLevelProgrammerAuthor Commented:
anyone?
0
 
Jamie McAllister MVPSharePoint ConsultantCommented:
If you absolutely need SPContext in an Event Handler you can use this approach;

http://blogs.msdn.com/b/andrasg/archive/2011/06/27/what-to-do-when-spcontext-is-null-but-you-need-it.aspx
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
GlobaLevelProgrammerAuthor Commented:
Can you explain what you mean by alternative access mapping and why that is a factor
0
 
Jamie McAllister MVPSharePoint ConsultantCommented:
You stated you were using Event Handlers? It's quite normal not to have access to SPContext in an event receiver. AAM doesn't come into it for that scenario.

http://blogs.msdn.com/b/andrasg/archive/2011/06/27/what-to-do-when-spcontext-is-null-but-you-need-it.aspx
0
 
GlobaLevelProgrammerAuthor Commented:
Great
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.