Re: properly disposing of filestream
- From: Michael Nemtsev, MVP <nemtsev@xxxxxxx>
- Date: Fri, 31 Aug 2007 05:59:15 +0000 (UTC)
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...@xxxxxxx> wrote:
B>
B> Oh well, I guess I will redo this with using. Thanks for all yourHello Bob,
AFAIK, u can't manage with this situation, because the VS debugger
prolongs handle releasing not when u close it, but when app finished.
Maybe there are some options to change this behaviour, but I'm not
aware about this
---
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> Hi,
B> I am getting an error "The process cannot access the file because
it
B> is being used by another process" when I debug a program more than
B> once. The file is being opened for append access with a
FileStream.
B> I have implemented IDisposable with the following code, am I doing
B> something wrong or is there a problem with pressing the "stop
B> debugging" button to end a program in a situation like this?
B> public void Dispose()
B> {
B> file1.Close();
B> file2.Close();
B> file1 = null;
B> file2 = null;
B> GC.Collect();
B> }
B>
B> Thanks,
B> Bob
B> input. Michael, do you think this would work if I ran as standalone
B> from exe instead of from Visual Studio?
B>
.
- References:
- Re: properly disposing of filestream
- From: Bob
- Re: properly disposing of filestream
- Prev by Date: Re: properly disposing of filestream
- Next by Date: Re: SQL sp execute perimmsion
- Previous by thread: Re: properly disposing of filestream
- Next by thread: Re: properly disposing of filestream
- Index(es):