PC Review


Reply
Thread Tools Rate Thread

ObjectDisposedException

 
 
HW
Guest
Posts: n/a
 
      29th Jun 2006
Hi, I'm seeing an ObjectDisposedException inside the Watch variable
of my FileStream object, the code is here dead simple when i Close the
Filestream object it doesn't get set to Nothing although the BinaryReader
object does get set to Nothing, what's wrong?

Dim FS As System.IO.FileStream
Dim BR As System.IO.BinaryReader

FS = File.OpenRead("Image.udb")

BR = New BinaryReader(FS)

Data = BR.ReadBytes(Length)

-------

FS.Close() Inside FS watch variable see ObjectDisposedException and FS is
NOT nothing

BR.Close() BR set to Nothing after this


















 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      29th Jun 2006
Try a little punctuation - I'm really not sure what you're saying or asking.

-Chris



"HW" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi, I'm seeing an ObjectDisposedException inside the Watch variable
> of my FileStream object, the code is here dead simple when i Close the
> Filestream object it doesn't get set to Nothing although the BinaryReader
> object does get set to Nothing, what's wrong?
>
> Dim FS As System.IO.FileStream
> Dim BR As System.IO.BinaryReader
>
> FS = File.OpenRead("Image.udb")
>
> BR = New BinaryReader(FS)
>
> Data = BR.ReadBytes(Length)
>
> -------
>
> FS.Close() Inside FS watch variable see ObjectDisposedException and FS
> is NOT nothing
>
> BR.Close() BR set to Nothing after this
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



 
Reply With Quote
 
HW
Guest
Posts: n/a
 
      29th Jun 2006
Sorry, i'm wondering why i am seeing an ObjectDisposedException
when i close the FS object. When i have FS set as a watch variable
in the debugger i see the exception inside the variable and it dosen't get
set to Nothing and is still pointing to an object after executing FS.Close
statement.

The BR object is correctly disposed. SO i'm wondering why the FS object
is not correctly disposed. The code looks ok to me.


"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:(E-Mail Removed)...
> Try a little punctuation - I'm really not sure what you're saying or
> asking.
>
> -Chris
>
>
>
> "HW" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi, I'm seeing an ObjectDisposedException inside the Watch variable
>> of my FileStream object, the code is here dead simple when i Close the
>> Filestream object it doesn't get set to Nothing although the BinaryReader
>> object does get set to Nothing, what's wrong?
>>
>> Dim FS As System.IO.FileStream
>> Dim BR As System.IO.BinaryReader
>>
>> FS = File.OpenRead("Image.udb")
>>
>> BR = New BinaryReader(FS)
>>
>> Data = BR.ReadBytes(Length)
>>
>> -------
>>
>> FS.Close() Inside FS watch variable see ObjectDisposedException and FS
>> is NOT nothing
>>
>> BR.Close() BR set to Nothing after this
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
HW
Guest
Posts: n/a
 
      30th Jun 2006
It is getting thrown as inner exception. How does one go about
solving inner exceptions?


"HW" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Sorry, i'm wondering why i am seeing an ObjectDisposedException
> when i close the FS object. When i have FS set as a watch variable
> in the debugger i see the exception inside the variable and it dosen't get
> set to Nothing and is still pointing to an object after executing FS.Close
> statement.
>
> The BR object is correctly disposed. SO i'm wondering why the FS object
> is not correctly disposed. The code looks ok to me.
>
>
> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
> news:(E-Mail Removed)...
>> Try a little punctuation - I'm really not sure what you're saying or
>> asking.
>>
>> -Chris
>>
>>
>>
>> "HW" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> Hi, I'm seeing an ObjectDisposedException inside the Watch variable
>>> of my FileStream object, the code is here dead simple when i Close the
>>> Filestream object it doesn't get set to Nothing although the
>>> BinaryReader
>>> object does get set to Nothing, what's wrong?
>>>
>>> Dim FS As System.IO.FileStream
>>> Dim BR As System.IO.BinaryReader
>>>
>>> FS = File.OpenRead("Image.udb")
>>>
>>> BR = New BinaryReader(FS)
>>>
>>> Data = BR.ReadBytes(Length)
>>>
>>> -------
>>>
>>> FS.Close() Inside FS watch variable see ObjectDisposedException and FS
>>> is NOT nothing
>>>
>>> BR.Close() BR set to Nothing after this
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ObjectDisposedException Hilton Microsoft Dot NET Compact Framework 2 5th Jan 2008 09:07 AM
ObjectDisposedException Evan Watson Microsoft Dot NET Compact Framework 1 7th Feb 2005 04:17 PM
ObjectDisposedException Ray Manning Microsoft Dot NET Framework Forms 0 5th Dec 2004 09:07 PM
ObjectDisposedException ? =?Utf-8?B?R8OpcmFyZA==?= Microsoft Dot NET Compact Framework 1 9th Jun 2004 03:17 PM
RE: ObjectDisposedException Yan-Hong Huang[MSFT] Microsoft Dot NET 0 22nd Jul 2003 08:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.