Sue Hernandez's Blog

December 4, 2011

MOSS SPSecurity.RunWithElevatedPrivileges Object Reference Not Set

Filed under: MOSS, Visual Studio 2010 — Susan Hernandez @ 6:58 pm

MOSS (SharePoint 2007) SPSecurity.RunWithElevatedPrivileges Object Reference Not Set to an Instance of an Object.

There are a few post out there regarding permissions on the database, and permissions on a local account group; however I just barely found, and wanted to pass on -

If you’re using Visual Studio and you’re running in Debug mode, and you’re either getting the Object Reference on SPSecurity.RunWithElevatedPrivileges or you’re getting a File Not Found error (“Web application at … could not be found”) on new SPSite(webURL), then you might want to check your configuration options.  Are you running in x86 mode and your site is build on 64 bit? 

What I did was I changed my build configuration from x86 to “Any CPU” and that made both exceptions go away.

~Sue

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.