Microsoft Knowledge Base Email Alertz

KBAlertz.com: Error message when you try to iterate through Windows SharePoint Services site objects or SharePoint Server 2007 site objects by using the SharePoint object model: Unhandled Exception: System.IO.FileNotFoundException

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **


Community Site



We Send hundreds of thousands of emails using ASP.NET Email


ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 935751 - Last Review: July 31, 2007 - Revision: 2.0

Error message when you try to iterate through Windows SharePoint Services site objects or SharePoint Server 2007 site objects by using the SharePoint object model: "Unhandled Exception: System.IO.FileNotFoundException"

SYMPTOMS

You try to iterate through Microsoft Windows SharePoint Services 3.0 site objects or Microsoft Office SharePoint Server 2007 site objects in a custom Microsoft Windows-based application or in a custom console application. You do this by using the Windows SharePoint Services object model or the SharePoint Server 2007 object model.

When you do this, you receive the following error message:
Unhandled Exception: System.IO.FileNotFoundException

CAUSE

This issue occurs if the user account under which the application runs has insufficient permissions.

If code is executed from a custom Windows-based application or from a custom console application, the code path does not use the Web context that is hosted by the Microsoft Internet Information Services (IIS) application pool. Therefore, specific user permissions are required in SharePoint Server 2007 and in the back-end data source.

RESOLUTION

To resolve this issue, make sure that the following conditions are true for the user account under which the application runs:
  • The user is a server farm administrator.
  • The user has Read and Write permissions on the content database.
  • The user is a site collection administrator.
  • The user has permissions to access the Windows SharePoint Services site or the SharePoint Server 2007 site through which the code iterates.

MORE INFORMATION

For more information about the SharePoint Server 2007 object model, see the Microsoft Office SharePoint Server 2007 Software Development Kit (SDK). To do this, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms550992.aspx (http://msdn2.microsoft.com/en-us/library/ms550992.aspx)
Alternatively, download the SharePoint Server 2007 SDK. To do this, visit the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en (http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en)
For more information about the Windows SharePoint Services 3.0 object model, see the Windows SharePoint Services 3.0 SDK. To do this, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms441339.aspx (http://msdn2.microsoft.com/en-us/library/ms441339.aspx)
Alternatively, download the Windows SharePoint Services 3.0 SDK. To do this, visit the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?familyid=05E0DD12-8394-402B-8936-A07FE8AFAFFD&displaylang=en (http://www.microsoft.com/downloads/details.aspx?familyid=05E0DD12-8394-402B-8936-A07FE8AFAFFD&displaylang=en)

APPLIES TO
  • Microsoft Office SharePoint Server 2007
  • Microsoft Windows SharePoint Services 3.0
Keywords: 
kbtshoot kbprogramming kbprb kbexpertiseinter KB935751
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please