FileNotFoundException when using SPSite in a console application

Posted: 23rd March 2011 in Sharepoint 2010, Visual Studio 2010, x64

Rather than building something which had to be deployed to SharePoint which was of no use to the application. I decided it would be easier to just, quickly, build a console application to get some values and write them to a file. This was the way I had done it before using MOSS. However, when I did this on the Sharepoint 2010, it complained with FileNotFoundException. image As can be seen in the image below.

This puzzled me at first, but after some digging I found that not only do you have to change the .NET Framework imageversion to 3.5, but you also have to set the platform target to x64.  This is done from the build tab of the project properties.

Once you know, it makes sense, but at first it caused a little confusion!

Advertisements

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 )

Google+ photo

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

Connecting to %s