This will work, but you should know that it freezes all the threads in your
process for the duration of the GC.Collect(). So you should be very careful
in running this in a multi-threaded environment such as COM+ or ASP.NET.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.