Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
When I open autocad drawing file template for change or create which is in memory. I fill the information in file and after that i save as that file or save then some time Error writing/closing file error occures. Pls help me.
Amol
Posted

1 solution

The problem (surprisingly) is probably in the file open code, rather than the save.
I assume that you are using a Stream object of some type? Enclose the Stream in a using block, or manually call Dispose when you are finished with it. If the object is not disposed when you come to write to the file again, the open object can hold a lock on the file, preventing you from writing it. If the Garbage Collector runs in the mean time, it may call the Dispose for you, but if you do it manually the lock should always be released.
 
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