Sign In
Share-n-dipity
SharePoint serendipity is the effect by which one accidentally discovers something fortunate, especially while looking for something else entirely. In this case, it is the occassional musings, observations, and Ouija board readings about the phabulously
Options
Blog Home
Share this
RSS for posts
Atom
RSS for comments
Search Blogs
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
ACS
ADFS
Authentication
Azure
CASI Kit
Claims
Client OM
Debugging
Development
FAST
Installation
Monitoring
Multitenant
New Features
oAuth
Operations
Performance
PowerShell
RMS
Search
SharePoint 2010
Social
Troubleshooting
Visual Studio 2010
Windows Phone 7
Archive
Archives
May 2012
(3)
April 2012
(1)
March 2012
(3)
February 2012
(3)
January 2012
(2)
December 2011
(3)
November 2011
(1)
October 2011
(5)
September 2011
(5)
August 2011
(4)
July 2011
(5)
June 2011
(6)
May 2011
(3)
April 2011
(4)
March 2011
(6)
February 2011
(5)
January 2011
(4)
December 2010
(2)
November 2010
(12)
October 2010
(2)
September 2010
(6)
August 2010
(8)
July 2010
(8)
June 2010
(8)
May 2010
(8)
April 2010
(4)
March 2010
(6)
February 2010
(11)
January 2010
(4)
December 2009
(5)
November 2009
(13)
October 2009
(10)
June 2009
(4)
May 2009
(1)
File Not Found Error with SharePoint 2010 and Visual Studio 2010
TechNet Blogs
>
Share-n-dipity
>
File Not Found Error with SharePoint 2010 and Visual Studio 2010
File Not Found Error with SharePoint 2010 and Visual Studio 2010
Steve Peschka
16 Nov 2009 7:18 AM
Comments
1
Hey folks, I've had this happen to me a couple of times and it's driven me a little crazy figuring out what was going on. You may use Visual Studio 2010 to create a new SharePoint 2010 application. You do something innocuous like using (SPSite theSite = new SPSite(myUrl)) and when the code executes, you get the dreaded "file not found" exception. So what's going on? Well what I've seen happen to myself and a few others, is that VS 2010 is targeting the .NET Framework 4.0 by default. SharePoint 2010 is using the .NET Framework 3.5. So the first step is you go in and change the version of the framework you are targeting to 3.5. You go and run your app again and what happens? Same error. Well the problem it appears is that when you change the target framework version, it also changes the target CPU from Any CPU to x86. Of course, SharePoint 2010 is
only
x64, so of course when your x86 app tries to load an x64 assembly, it fails and and in really weird way the file not found exception then makes sense. Okay, that's kind of apologistic but you get the gist. So step 2 here is obviously to go back and change your target CPU back to Any CPU and you should be good. That has fixed the problem a number of times for different people now - hope it helps you too.
1 Comments
SharePoint 2010
,
Development
,
Debugging
,
Visual Studio 2010
Comments
Comments
Loading...
Leave a Comment
Name
Comment
Please add 8 and 6 and type the answer here:
Post