“Object reference not set to an instance of an object” when calling SPFarm.Local

If you are getting “Object reference not set to an instance of an object” when calling SPFarm.Local in a stand-alone app (e.g. console app), and you are developing against SharePoint 2010, then check that your project is set to target x64 or Any CPU. Setting it to target x86 (which is the default in VS 2010) will give you that error.

Unknown's avatar

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in SharePoint 2010. Bookmark the permalink.

Leave a comment