Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 130887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:01:07+00:00 2026-05-11T06:01:07+00:00

I am working on a win app which accesses the Outlook personal folders. Internally,

  • 0

I am working on a win app which accesses the Outlook personal folders. Internally, it mounts the personal folder on the Outlook instance and processes the mails and then unmounts the pst. After unmounting the pst, I delete that file.

Now the problem is that even after un mounting the pst and releasing memory, when I try to delete the pst, I get an exception that some process is using this file so it can not be deleted. And that process is outlook. I am using following code to un mount and release memory:

 _application.Session.RemoveStore(_personalFolder);  while (System.Runtime.InteropServices.Marshal.ReleaseComObject(_personalFolder) >= 0) ;  _personalFolder = null; 

I checked it many times and it seems as if it takes some time to release memory and there is no definite time for this. Could any one help me how to delete the file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:01:08+00:00Added an answer on May 11, 2026 at 6:01 am

    Have a look at KB234228 (‘OL97: Outlook .pst File Lock Release Interval Now Configurable’). It is about Outlook 97, but I would guess that it still works.

    I guess that FileSystemWatcher will not help you, since there is no ‘exclusive lock released’ event.

    So maybe you can make a worker thread, that continuously tries to delete all the .pst files you put in a queue. This way your application UI can at least go on uninterrupted.

    Tools like ProcMon do have the ability to look at the file handles of applications. Maybe you are able to make an API call that allows you doing that for the Oulook process (That’s good material for another SO question, I guess). This way you don’t have to poll the file system, and can act more quickly when the lock is gone.

    If you dare, you might even try and close the file handle in question right away, removing the need to poll/wait altogether.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Give a look to this book: patterns & practices Application… May 12, 2026 at 1:16 am
  • Editorial Team
    Editorial Team added an answer It's been a while since I've used Prototype, but on… May 12, 2026 at 1:16 am
  • Editorial Team
    Editorial Team added an answer Hi, I was wondering why MYSQL uses a single equals… May 12, 2026 at 1:16 am

Related Questions

I'm in the process of teaching myself WPF, and I have run into a
What is the best approach to implementing authorisation/authentication for a Windows Forms app talking
I am working on a windows application. I need to simulate Session (that we
FYI - I am a mainframer that moved to the .NET world a couple

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.