SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Farm level feature that returns null when I try to access SPContect.Current.Site. Is another way to grab a list of site collections? I have access to SPFarm.Local

share|improve this question
up vote 1 down vote accepted

Check this link... You need to get the web applications first then iterate through each web application's sites.

Can't this be a web applicatiion feature? Why exactly would you make it a farm feature?

share|improve this answer
I'm uploading InfoPath forms. I guess maybe it could be a Web Application feature, I haven't tried yet. – Meyer Denney Sep 15 '12 at 0:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.