From: shapper on
Hello,

I have a class that writes to a MemoryStream but I am getting a
strange error:

ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
of type 'System.InvalidOperationException'

base {System.SystemException} = {"Timeouts are not supported on this
stream."}

Source = "mscorlib"

WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
exception of type 'System.InvalidOperationException'

base {System.SystemException} = {"Timeouts are not supported on this
stream."}

Source = "mscorlib"

Any idea why might be wrong?

I really have no idea.

Thank You,

Miguel
From: Family Tree Mike on
On 5/20/2010 11:57 AM, shapper wrote:
> Hello,
>
> I have a class that writes to a MemoryStream but I am getting a
> strange error:
>
> ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
> of type 'System.InvalidOperationException'
>
> base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
> Source = "mscorlib"
>
> WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
> exception of type 'System.InvalidOperationException'
>
> base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
> Source = "mscorlib"
>
> Any idea why might be wrong?
>
> I really have no idea.
>
> Thank You,
>
> Miguel

I see you are posting this and at least one other question here and to
the forums as well.

MemoryStreams don't support timeouts and it is documented that some
streams throw an exception. If you have a timeout on a memory stream,
you have bigger concerns to worry about, like needing a new computer...

--
Mike
From: Jeff Johnson on
"shapper" <mdmoura(a)gmail.com> wrote in message
news:98424b2f-c282-437a-9191-f8afcd5434f0(a)o39g2000vbd.googlegroups.com...
> Hello,
>
> I have a class that writes to a MemoryStream but I am getting a
> strange error:
>
> ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
> of type 'System.InvalidOperationException'
>
> base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
> Source = "mscorlib"
>
> WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
> exception of type 'System.InvalidOperationException'
>
> base {System.SystemException} = {"Timeouts are not supported on this
> stream."}
>
> Source = "mscorlib"
>
> Any idea why might be wrong?

Yes: memory will never time out, so there's no point in MemoryStream
supporting these properties, and .NET is slapping you on the wrist for
accessing them when you shouldn't be.


From: Jeff Johnson on
"Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
news:OAhuokD%23KHA.4564(a)TK2MSFTNGP05.phx.gbl...

> If you have a timeout on a memory stream, you have bigger concerns to
> worry about, like needing a new computer...

<snicker>


From: shapper on
On May 20, 5:26 pm, Family Tree Mike <FamilyTreeM...(a)ThisOldHouse.com>
wrote:
> On 5/20/2010 11:57 AM, shapper wrote:
>
>
>
> > Hello,
>
> > I have a class that writes to a MemoryStream but I am getting a
> > strange error:
>
> > ReadTimeout = '((System.IO.Stream)(s)).ReadTimeout' threw an exception
> > of type 'System.InvalidOperationException'
>
> >    base {System.SystemException} = {"Timeouts are not supported on this
> > stream."}
>
> >      Source = "mscorlib"
>
> > WriteTimeout = '((System.IO.Stream)(s)).WriteTimeout' threw an
> > exception of type 'System.InvalidOperationException'
>
> >    base {System.SystemException} = {"Timeouts are not supported on this
> > stream."}
>
> >      Source = "mscorlib"
>
> > Any idea why might be wrong?
>
> > I really have no idea.
>
> > Thank You,
>
> > Miguel
>
> I see you are posting this and at least one other question here and to
> the forums as well.
>
> MemoryStreams don't support timeouts and it is documented that some
> streams throw an exception.  If you have a timeout on a memory stream,
> you have bigger concerns to worry about, like needing a new computer...
>
> --
> Mike

Sorry, both questions are related to the same problem.
The first is to solve it and the second is an alternative I am trying
to use to check if it solves it.

This is driving me crazy for hours and I decided to post in the two
different forums to try to get some help.
Didn't know the forums are related ....

Should I post only in one? Which one? I just though the communities
were different ...

Sorry but it sounds strange this is a problem with my computer ...

Maybe the fact that I am using NET 4.0?

The CSVWriter class is:
http://kbcsv.codeplex.com/SourceControl/changeset/view/42031#530488

I can't find what might be the problem ...