Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
one of my outlook addin i develop a form (main form) to load at manu button click event and that main form is using stremreader to access some source files

but when main form is close and try to open again using outlook manu button it giving error msg that
Error The process cannot access the file "C:\\WorndNet\\index.adj" because it is being used by another process
pls help me Thanx
Posted

1 solution

Best guess: you do not close and dispose your FileStream objects.

If you open a file, and do not close and dispose it, then it remains open until the garbage collector comes along and decides it needs the space. At that point the file will be closed, and the object disposed. Until then, all other attempts to access the file will fail.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900