Saturday, February 2, 2013

SPFarm returns null

Have you ever been into a situation when you have written a code which initiate a SPFarm with simple line of code and when you execute, you get SPFarm as null though you are running windows application on the server itself. What went wrong?

So go to the project properties and check for the build version. When you create a project, there are chances that the project is created in the x86 environment, so go ahead and change it to x64 because SharePoint code cannot run in x86 set up.

Problem must be solved now.

No comments:

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to