Tuesday, January 11, 2011

SPWeb GetList Exception from HRESULT: 0x80070003 System.IO.DirectoryNotFoundException

If you see something like this while calling while calling  SPWeb.GetList("BlahBlahBlah"), do not get alarmed.
All you need to provide is a site-relative URL like the following
"/sites/myWeb/Lists/myCoolList".
If you are in the top-lelel site collection and wondering what the heck , then it should be like "/Lists/myCoolList"

"Unhandled Exception: System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)"

1 comment:

Bowsil Ameen said...

Hi Kopperla,

for some of my site collection i am getting error like this(this is in farm environment)

Server Error in '/' Application.
--------------------------------------------------------------------------------

The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)]
Microsoft.SharePoint.Library.SPRequestInternalClass.OpenWeb(String bstrUrl, String&

need you help on the same