> Hello Bob,
>
[quoted text clipped - 29 lines]
> B> Thanks,
> B> Bob
Oh well, I guess I will redo this with using. Thanks for all your
input. Michael, do you think this would work if I ran as standalone
from exe instead of from Visual Studio?
Michael Nemtsev, MVP - 31 Aug 2007 06:59 GMT
Hello Bob,
Try to use the release version of the EXE for the one app, and debug from
VS the another instance.
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
B> On Aug 30, 11:53 pm, Michael Nemtsev, MVP <nemt...@msn.com> wrote:
B>
>> Hello Bob,
>>
[quoted text clipped - 31 lines]
>> B> Thanks,
>> B> Bob
B> Oh well, I guess I will redo this with using. Thanks for all your
B> input. Michael, do you think this would work if I ran as standalone
B> from exe instead of from Visual Studio?
B>
Lasse Vågsæther Karlsen - 31 Aug 2007 08:17 GMT
> Oh well, I guess I will redo this with using. Thanks for all your
> input. Michael, do you think this would work if I ran as standalone
> from exe instead of from Visual Studio?
I don't understand your remarks about "using".
As long as you make sure you actually call the Dispose method when
you're done with your object, it should be fine. It should not matter
*how* Dispose was called.
Seeing the code that uses your object would perhaps give us a clue, as
would more explanation of how you're treating the object.
I suspect, however, that you're not calling Dispose and you trust GC to
do it, which it won't.
Also, as remarked by others, GC.Collect() is typically not necessary and
you should instead have a really good reason for using it.

Signature
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
> AFAIK, u can't manage with this situation, because the VS debugger prolongs
> handle releasing not when u close it, but when app finished.
Can't say I've run into this - it should be fine. FileStream.Dispose
(bool) *does* dispose of the handle.
Maybe this was a bug in .NET 1.1, but I think it's fine now.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too