Microsoft KB Archive/935751

= 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: &quot;Unhandled Exception: System.IO.FileNotFoundException&quot; =

Article ID: 935751

Article Last Modified on 7/31/2007

-

APPLIES TO


 * Microsoft Office SharePoint Server 2007
 * Microsoft Windows SharePoint Services 3.0

-



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

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

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

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

Additional query words: moss moss2007 wss run execute api wssv3

Keywords: kbtshoot kbprogramming kbprb kbexpertiseinter KB935751

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.