The process cannot access the file because it is being used by another process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • monalijoshi
    New Member
    • Sep 2011
    • 2

    #1

    The process cannot access the file because it is being used by another process

    Hi all,

    Here am using FileStream in append mode.StreamWrit er is also used.when on debugging my application my application will give following exception: The process cannot access the file because it is being used by another process.
    as i already close and dispose the object of it.
    and "using" is also used here.but error is same
    so please suggest me the solution.
  • invoked
    New Member
    • Oct 2011
    • 4

    #2
    This would easier to troubleshoot if we could see a code snippet. It sounds like you are utilizing the using correctly, as well as Close and Dispose, but are you using Flush as well?

    If you are writing a file and then trying to access it again, you may try a second using block and see what happens, but likely the issue will happen again.

    Good luck!

    Comment

    Working...