((System.IO.Stream)(s)).ReadTimeout. What might be wrong?

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
0
shapper
5/20/2010 3:57:20 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

5 Replies
18629 Views

Similar Articles

[PageSpeed] 10

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
0
Family
5/20/2010 4:26:13 PM
"shapper" <mdmoura@gmail.com> wrote in message 
news:98424b2f-c282-437a-9191-f8afcd5434f0@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. 


0
Jeff
5/20/2010 4:27:52 PM
"Family Tree Mike" <FamilyTreeMike@ThisOldHouse.com> wrote in message 
news:OAhuokD%23KHA.4564@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> 


0
Jeff
5/20/2010 4:31:59 PM
On May 20, 5:26=A0pm, Family Tree Mike <FamilyTreeM...@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 =3D '((System.IO.Stream)(s)).ReadTimeout' threw an exceptio=
n
> > of type 'System.InvalidOperationException'
>
> > =A0 =A0base {System.SystemException} =3D {"Timeouts are not supported o=
n this
> > stream."}
>
> > =A0 =A0 =A0Source =3D "mscorlib"
>
> > WriteTimeout =3D '((System.IO.Stream)(s)).WriteTimeout' threw an
> > exception of type 'System.InvalidOperationException'
>
> > =A0 =A0base {System.SystemException} =3D {"Timeouts are not supported o=
n this
> > stream."}
>
> > =A0 =A0 =A0Source =3D "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. =A0If 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 ...
0
shapper
5/20/2010 5:20:28 PM
On 5/20/2010 1:20 PM, shapper wrote:
> On May 20, 5:26 pm, Family Tree Mike<FamilyTreeM...@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 ...

Find the line that the exception occurs.  This line is presumably a 
WriteTimeout or ReadTimout property on a stream being set.  If this is 
in the CSVWriter class, then the class has a bug, because it cannot work 
with MemoryStreams.  If it is your code, it is because you cannot set 
the properties.  Setting the properties throws this exception, not a 
timeout during your read/write with the memory stream.  This is because 
memory streams do not timeout.  They cannot time out.

-- 
Mike
-1
Family
5/20/2010 8:38:01 PM
Reply:

Similar Artilces:

Office H&S 2007 over a trial version
I am trying to install on a Compaq laptop that came bundled with Office 2007. It expired so I bought the student edition. It gives an error when trying to install. The error it gives is real generic:"Setup encountered an error" and that's it. I tried to uninstall what came with the laptop, but that also gives an error when uninstallling. I have came up in safe mode and tried to uninstall, same problem. I have tried the fixit program from MS. It runs and looks like it works, but I can still not install the student edition. Any one have any ideas? thanks. ...

IE 9
I have Win XP3 / 64-bit......IE6 I have tried IE 8 but didn't like it, so went back to the tried and true. Seems now sites are not supporting IE6 so we user won't be able to see their sites without upgrading. Is there any spec page that will tell us what it's going to have and not have ? My dislike of IE8 was the way the favorites showed up when you wanted to save a link. IE6 it opened with just the folders and made it very easy to find where you wanted to put the link. IE8 opened "every" folder one has in their favorites. I would have to go up and d...

When viewing an MFC dll's dependancies can't seem to find MFC80D.d
While compiling a project that has recentlly been upgraded to VS2005 from VS6.0 i keep getting a registration error. at the end of the process the project tries to register the newly compiled DLL. when i looked at the DLL through Dependancy Walker i discovered that it could not seem to find three DLLs: MFC80D.dll, msvcp80d.dll and msvcr80d.dll. any ideas why this would happen? On Oct 20, 7:28 am, Shawn <Sh...@discussions.microsoft.com> wrote: > While compiling a project that has recentlly been upgraded to VS2005 from > VS6.0 i keep getting a registration error. at the end of ...

Wrong labels print
When I print more than 1 different ILC using the label wizard it prints the correct total number of labels but all of then are the field-values for the first label in the list. example 3 OF Ilc 39725 and 2 of Ilc 39730 will print 5 of Ilc 39725 I have tried different Ilcs and have the same problem If I use a Avery Label it print OK. I'm running V 1.3.1002 on XPPro w/SQLEXpress The Eltron code is below ... 'BM_HangTag [INITIALIZE] N ZB Q278,20+0 R0,0 S1 D7 [LABEL] LO506,4,56,1 LO506,237,56,1 LO506,5,3,232 LO559,5,3,232 A200,190,3,4,2,1,R,"BETH MONE" A260,230,3,3,1,1...

where can i find a list of excell formula's? #2
I'm learning to use excel more and more and i would like to know how to create a formula that subtracts one cell from another. Is there a list of formula's for excel? Look in HELP contents for function index -- Don Guillett SalesAid Software donaldb@281.com "Art" <Art@discussions.microsoft.com> wrote in message news:DFF58A3A-86CE-415C-A471-0F995F95C108@microsoft.com... > I'm learning to use excel more and more and i would like to know how to > create a formula that subtracts one cell from another. Is there a list of > formula's for excel? Art, y...

Macro Error when moved Xcel Sheets from User's Home Dir to Networ
Hello Xcel spreadsheets Copied from User's Network Home Folder to Another Network Folder. copy \\network\home\userA\*x.s \\network\REPGROUP Getting "object variable or with block.." What else I need to copy, when copying from one network location to another. I reverted back to old way, still same problem Thanks Basheer Use FileCopy to copy files. -- Jim "Basheer" <Basheer@discussions.microsoft.com> wrote in message news:744DF6C5-96B3-48B2-99AF-657487D87FCD@microsoft.com... | Hello | Xcel spreadsheets Copied from User's Network Home Folder to Another...

ShellExcute and System Path
I have Windows XP and Windows Vista PC's. I need to use ShellExcute in my MFC application and run the dos ping command with a hidden window. Can some gentleman here give the right syntax? Regards Ronny maybe IcmpSendEcho IcmpSendEcho2 IcmpSendEcho2Ex can help you. a sample from MSDN: #include <winsock2.h> #include <iphlpapi.h> #include <icmpapi.h> #include <stdio.h> #pragma comment(lib, "Iphlpapi.lib") #pragma comment(lib, "Ws2_32.lib") int __cdecl main(int argc, char **argv) { // Declare and initialize variables HANDLE hIcmpFi...

System Administrator Error
When I send e-mails to someones out of the office, I get a message that says the file is "Undeliverable" and the error message reads "System Administrator". But, I can send e-mails to others in the office and I can receive e-mails just fine. I am running Outlook 2003 on Windows XP with all the updates and service packs What could be the problem? ...

Error: "The file(s) could not be saved to the selected folder"
Hi, I need help with Groove: I'm trying to save one of Groove folders to my local disk, and keep getting this error message: - Save File(s) Error - The file(s) could not be saved to the selected folder. The file path may be too long or you may not have access to the selected folder. Please select another folder. Any idea? ...

System attendant mailbox manager report
I'm not sure how to track this one down. I am running Exchange 2003 sp2 on two Exchange servers they function as backends. I keep getting a System attendant email sent to me for a thats says "The Microsoft Exchange Server Mailbox Manager on SCMAIL1 completed processing successfully". This is all good and fine, but what i dont understand is what recipient policy is generating this because when i check my recipient policies none of them are configured for mailbox manager settings, so i dont understand why i keep getting the email and the attached report. Is there a way to ...

Tasks doble it's size
Hi! Does anyone know why the size of one of my tasks dobles when I just change one word e.g.? I dobles like this: from 200 kb to 400 kb to 800 kb and so forth. No the size of it is 12 mb and it contains only text (HTML-format). Now that it's that big I have to delete something in it to make a new note to it. How can I resolve this problem? I'm using Outlook 2003 (Office2003 and WinXP). Thanks in advanced! Tina :-) ...

P L E A S E
Please, could someone help me with "DLL (Resource)" post (some 25 posts below this post). Please. Thank you. "Jan Plastenjak" <none@ms.com> wrote in message news:ewOtE0A3DHA.2700@tk2msftngp13.phx.gbl... > > Please, could someone help me with "DLL (Resource)" post (some 25 posts > below this post). Please. What? I'm to search through the newsgroup looking for find your post? I don't think so... Cheers Richard. Jan, I have already answered your post, let me repeat it: "If you go to www.microsoft.com and enter the fo...

MS Money 2004 at Sam's Club?
Has anyone seen MS Money 2004 at Sam's Club? I'm in the Dallas area. Thanks, Patrick I saw M2004 Deluxe for $32 something at local (central Ohio) Sam's. Mo mention of any rebates in the store or on the box or Sam's web site.. -- Aloke --- to reply by e-mail remove 123 and change invalid to com "P. H. Fanelli" <pfanelli@advantexmail.net> wrote in message news:vi4raertkt6q31@corp.supernews.com... > Has anyone seen MS Money 2004 at Sam's Club? I'm in the Dallas area. > > Thanks, > Patrick > > I guess I'll have to find a ne...

Host another AD domain's email on Exchange 5.5/2003
Problem: I need to host the email for a small subsidiary who is in their own AD forest and currently using a hosted email service that will be going away mid-next year. I currently use Exchange 5.5 in my domain and I feel confident that I can setup them up with a domain-trust and host their email on my Exchange box. However I am also going to be migrating to Exchange 2003 next year. Questions: Can I go ahead and set this up, or (as I'm suspecting) would it be better to hold off on setting this up until after completing the Exchange 2003 migration? Thanks, Kumbi "Kumbi" &...

attachment's
when i click on an attachment it opens automatically the warning dialog box that usually opens either open/save to disc does not pop up someone removed the check mark "always ask before opening this type of file" how do i re-enable this prompt Open Windows Explorer and select Tools | Options. Go to File Types tab. Highlight the file type and then select Advanced button. Make sure the confirm after download checkbox is checked. -- Neo [MVP Outlook] Due to recent events in spam and malicious programs, all e-mails sent to this account will be deleted w/out reading. "ron"...

What's the 3rd Virtual PC disk for?
Just got Virtual PC for Mac, installed it, and was only called upon by the installation program to use the first two installation disks. But there's a 3rd disk, called "Additional Windows system files". I'm curious: what's this for, and when would I use it? Haven't a clue. Try the VPC newsgroup. http://groups-beta.google.com/group/microsoft.public.mac.virtualpc On 7/9/05 9:56 AM, "Office 2004 Test Drive User" wrote: > Just got Virtual PC for Mac, installed it, and was only called upon by the > installation program to use the first two installat...

How to filter rows with commom N�'s in any column
Hello, How is it posible to filter the common N� that may appear in an coloumn Examlpe: A B C D E F 2 6 8 10 15 20 1 2 5 16 25 30 4 8 12 19 45 48 2 4 15 20 25 28 6 9 19 29 39 49 8 19 25 28 41 45 In this example I want to filter all the rows that have the commo N�8 The filtered Result Should be shown as below: A B C D E F 2 6 8 10 15 20 4 8 12 19 45 48 8 19 25 28 41 45 Thank You Moti -- Message posted from http://www.ExcelForum.com Add a new column to the table, and...

Counting Unique Record #s
I have a database showing assignments with their subassignments. On reports, I am attempting to count unique AssignmentIDs under groups (for example different months the assignments are due). Unfortunately, if the assignment has two (or more) sub assignments, the count function counts the AssignmentID twice (since it lists the AssignmentID with the SubAssignment ID). Do you know a way to get around this so I can count how many unique main assignments are under each group? Totals query. GroupBy your "group"; Count your AssignmentID. Regards Jeff Boyce Microsoft Office/Ac...

Changing the system state backup
Hey All, I was wondering if the following is possible: For a system state backup, you can easily change the location on the server by changing the configuration. But I would like to know if you can change it to a networked drive? I have the situation that there are a few servers (2008, non R2) with only a C: drive that doesn't have enough free space left for the backup and no other drives available. Thanks Mike Thanks for reaching the newsgroup for raising this issue, When system state is backed-up to a \\machine1\share, it can't be backed-up from ...

Check Other User's Calendar Macro
Here is my scenario: I work for a not-for-profit company with no budget for purchasing any new apps or software. We do not have Exchange Server and use Outlook 2002. Two people in the office want to share there calendar info so that they can book appointments without having to always contact each other. We have Windows Server 2003 R2. Is there a macro that would copy user A's calendar to a folder on our server (N:) and have that same calendar accessed by user B? Any information would be greatly appreciated. We have limited technical knowledge and no money to purchase exchange se...

Editing Cell's in Excell 03
I have a question. I use excell to create a CSV file so I can upload auctions at yahoo auctions. I have already a set of descriptions (since the description is one basic one for all auctions) listed in my database sheet. I want to change them, however when I select a sell the window pops down and shows ALL the description. I want to just copy the new description into all the cells at he same time...but it's not working properly. Does anyone know how I can get it to now show the whole cell information so I can copy the new description and paste the same information into all the descripti...

Microsoft offfice system 2007, Update instalation failed
Error Code: 0x80070663 Update for the 2007 Microsoft Office System (KB981715) Security Update for the 2007 Microsoft Office System (KB982312) Security Update for the 2007 Microsoft Office System (KB982331) I m trying to install this three updates but it's always says instalation failed. I tried in automatic update and in internet explorer. neither of these worked. my computer always says new updates found. my laptop is running on XP MEDIA CENTER EDITION. I am running MS office 2007. im getting the same messages and the same problem. i keep hiding them and they keep coming ...

Microsoft Access Hotel Reservation System templates
Does anyone know of an available MS Access hotel or bed & Breakfast reservation system template? MVP Albert D. Kallal has a reservation system. It isn't a template, but you should inquire about it to see if it's close to what you need. http://www.members.shaw.ca/AlbertKallal/ -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "Paul987" <Paul987@discussions.microsoft.com> wrote in message news:5B11BE9C-81BE-451E-BC7D-E903B844C37E@microsoft.com... > Does anyone know of an available MS Access ...

Find oldest warranty ExpDate(s) for each customer
I have a tblWarranties containing multiple entries for each customer. I would like to return a record set of only the oldest ExpDate(s) for each customer. It is possible that a customer would have multiple warranties with the same ExpDate, so I would want all. So it would need to ignore the customers warranty records with ExpDates older then the most current ExpDate. For instance, in the example below only the last two entries would be part of the record set. WarrantyType Term BeginDate ExpDate Original Warranty 2 09-01-01 09-30-03 Parts...

Please help!!! Information Store and System Attendant does not start
Hello Everyone, I have a couple of questions. Friday my exchange 2k box crashed on the windows side. I have put the exchange hard drives in a new pc. I repaired the drive by running the windows repair and bascially had to almost install windows again. However, it comes back up at win2k sp3. I reran the exchange sp3 patch on the server. All my drives look good. However, the information store and exchange system attendant will not start. I was wondering if anyone can give me advice on why this is happening? Also on a side note I can not remote desktop into this pc which is weird? I can ping...