locked
IsolatedStorageFileStream FileNotFoundException RRS feed

  • Question

  • I created a library years ago for Silverlight apps which writes exceptions to isolated storage and all has been fine until suddenly I started getting an exception on the line shown in the screenshot. If I continue executing the code it writes to the file as expected, so in summary, everything seems to work except that I get this exception.

    When I execute this exact same code from other Silverlight solutions it works OK with no exception.  Any ideas what's going on here?

    Thank you.


    • Edited by moondaddy Wednesday, October 12, 2016 3:41 AM
    Wednesday, October 12, 2016 3:39 AM

Answers

  • Hi moondaddy,

    Thank you for posting here.

    For the use of isolatedstoragefilestream, there is two ways could get the FileNotFoundException.

    • No file was found
    • The mode is set to open.

    Have you check the file open or not when you run the program.

    When you create the file, maybe the exception will happen.

    Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. This requires FileIOPermissionAccess.Write permission. FileMode.Create is equivalent to requesting that if the file does not exist, use CreateNew; otherwise, use Truncate. If the file already exists but is a hidden file, an UnauthorizedAccessException exception is thrown.

    I hope this would be helpful to you.

    If you have something else, please feel free to contact us.

    Best Regards,

    Wendy


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 13, 2016 8:43 AM