locked
Package.Dispose() on Low Disk space RRS feed

  • Question

  • You cannot vote on your own post
    0

    I opened a package in a low disk space.. and now I want to close the package and delete it.

    When i do the dispose on package it throw the expection of "not enough disk space"

    I use below code :

    package = Package.Open(filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);  -- to open

    try
                {
                     ((IDisposable)package).Dispose();
                   
                }
                catch (Exception)
                {
                  
                    GC.SuppressFinalize(package);
                }
                finally
                {
                    package = null;
                 
                }

     

    stil i cannot delete the file since the handler is open . How can i handle this situation ?

    Tuesday, June 21, 2011 3:30 AM

Answers

  • Hi,

    Welcome to the MSDN forum.

    Before you dispose or delete a native handle, I think you should close it firstly. If the handle's status is Open, it means it is being using. So I suggest you close it before dispose it.

    Have a nice day!


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Zhou Tuesday, June 28, 2011 8:08 AM
    Thursday, June 23, 2011 9:57 AM