Home > SharePoint, SharePoint 2010 > SharePoint (Beginner) : FileNotFoundException

SharePoint (Beginner) : FileNotFoundException

For a beginner developer in SharePoint 2010 (with no experience with older version of SharePoint), you might be coding some simple “Hello World!” as your first SharePoint application. You might create a new Windows Console Application Project from Visual Studio and copy some sample codes from somewhere and try to run it. So you hit the magical F5 button and your project compiles successfully. However, when the program tries to run, Visual Studio throws you an FileNotFoundException, like the image below.

SharePoint 2010: FileNotFoundException

SharePoint 2010: FileNotFoundException

You then might be searching for codes error, is the SharePoint service running, & etc and found out that everything is running fine. So what’s the error?

The solution to this is to check your project platform target. By default, Visual Studio platform target is 32-bit (x86). Note that SharePoint 2010 ONLY runs on a 64-bit (x64) platform. So, you couldn’t run a 32-bit program on a 64-bit SharePoint Server. Now, to change your project platform to 64-bit, follow the steps below:

  1. Right-click on your Project in the Solution Explorer pane in Visual Studio and select Propertise
  2. Go to the Build tab and select x64 OR Any CPU
  3. Save changes, rebuild and run your program again.

SharePoint 2010: FileNotFoundException - 2

  1. May 14, 2011 at 3:16 pm

    Good points

  2. May 23, 2011 at 7:14 pm

    thanks 🙂

  1. No trackbacks yet.

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

%d bloggers like this: