SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a block of code wrapped in an if:

SPFile mySPFile = web.GetFile(someURL);

if (mySPFile.Exists) /*returns true, enters code block*/ {
    //... make some updates
    mySPFile.Update(); //FAILS here, HRESULT 0x80070003 - File not found

If the file existed in the condition for the if, why can't it be found when I try to save the changes I made to its properties?

share|improve this question
We have a workaround: instead of going to the file (which is within a subsite) directly by URL, we are opening the containing subsite first and then accessing it by GUID. – sq33G Jun 3 '12 at 11:31

I would recomand you read this article from Waldek concerning problems revolving with web.GetFile() available at and confront with your code, particularly when you passing a certain URL to the method.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.