IO.FileNotFound_FileName exception when selecting a file in Silverlight

I don’t know how much this will help people – there’s only 7 results on Google for “IO.FileNotFound_FileName” at the time of writing so it’s clearly not a common problem – but one of our Mac users just reported an issue with selecting a file via a custom Silverlight control. They do this process day in, day out, but suddenly started getting the following error message:

Silverlight IO.FileNotFound_FileName exception

Silverlight IO.FileNotFound_FileName exception

I couldn’t find any evidence of people getting this problem before, the MS page it pointed me to was typically useless. The only suggestion I came across was that it might relate to diskspace having run out, but neither the Mac nor the external fileserver this file was being loaded from were low on space so that ruled that one out.

From a process of trial and error I managed to track the problem down to the folder these files were stored in which, whilst it appeared perfectly normal when viewed on a Mac, when accessed via Windows showed up as gobbledygook. Creating a new folder and copying all the contents over did the trick – the file could be selected and uploaded as before.

Clearly something went very screwy deep down in the OSX filesystem with that folder, though I have absolutely no idea what it might have been. Maybe I missed something really obvious (I have no experience with Macs to call on), but hopefully by bumping the number of Google results up to 8 I might one day save somebody a bit of time 🙂

This entry was posted in Fixes and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted July 30, 2012 at 7:46 pm | Permalink

    Hi Luke,

    I had same errors showing up on various client machines which were all kind of Windows OSes, browsers and SL versions. Today I have done an investigation and the error occurs when user tries to drop folder on file drag-n-drop aware application. The app works fine with multiple files dragged from directory. With normal click and open dialog there is no way to select directory, so no problem. I hope this may help somebody, thus I put is here because your article is on the top with “IO.FileNotFound_FileName”.

    Thanks.

  2. Luke Bennett
    Posted August 8, 2012 at 2:23 pm | Permalink

    Thanks Piotr. Sounds like a slightly different issue to mine, but adding your experience here gives any visitors to this post a better chance of dealing with their problem!

  3. TSKen
    Posted May 9, 2013 at 9:54 pm | Permalink

    Hi Luke,

    I have a client that has the exact same issue but it was related to SPACES in the file name. If the file has A{Space}b.doc, the error pop up. But if it’s renamed to ab.doc, the error goes away. We can’t seems to find a way to duplicate in our environment. On the other hand, if the file is copied over to the local drive (which match to your solution: create a new folder), the error goes away as well. I’m trying to see if this is a programming issue or a OS issue and isolated to MACs only. Please let me know what do you think.

    • Luke Bennett
      Posted May 11, 2013 at 9:35 pm | Permalink

      Interesting – the file name in my case didn’t contain a space, but it’s possible that the folder it was stored in did, I can’t remember now. Whilst spaces are supported in paths on all modern (and many not-so-modern) operating systems, I guess you can see how they might cause some issues if not handled properly in code – everything after the space might be getting ignored leaving an invalid path.

      I’ll be interested in hearing more about your particular issue if you make any progress with it.

Leave a Reply