((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
17306 Views

Similar Articles

[PageSpeed] 7

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:

Outlook changes my permissions...on it's own!
I keep running into problems with Rules and Permissions for folders. I have rules to send certain email to folders, which works for some number of days, but for some reason, Outlook will arbitrarily block the rule, saying I don't have permission to do that to a folder. I get a message to check with my system administrator, who I guess would be me. The administrator choices are grayed out so I can't change any settings. I've used 'detect and repair' even to the point of resetting my defaults, but nothing works. Any ideas would be very welcome. I'm using Outlook 2003. Tha...

Unable to copy other's Contacts folder
To All, User A delegated and granted me full permission to access his Contacts list. My permission level is Owner. I can do anything but copy the whole "Contacts folder" to my mailbox. It says no permission. Anyway that I can copy other's Contacts folder into my mailbox. THanks Calvin Can you copy individual items? If so, create a new folder and copy the contacts to it - use By Category view to make it easier to see all of the contacts. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart...

STOP 0xF7 SR.SYS BSOD copying Internet Shortcut(s)
I have repeatedly experienced STOP 0x000000F7 in sr.sys "A driver has overrun a stack-based buffer" while attempting to copy a set of Internet Shortcuts to a USB drive using the XCOPY command. I infer that there is something wrong with the file name by default when shortcuts to http://www.likewise.com/index.php are added to IE Favorites. I have been able to work around the problem by simply renaming the shortcut. System is running XP SP3, AFAIK with all known production security patches. Does anyone know of a fix for this issue? See the following http://aumha.o...

System Administrator Error messages? #3
Hello all, A bunch of us in my office using the same ISP are getting error messages from Outlook 2003 (and XP) saying that: Your message did not reach some or all of the intended recipients. Subject: New Address Sent: 4/15/2005 12:07 PM The following recipient(s) could not be reached: XXXXXXXXXXXXXX ' on 4/15/2005 12:07 PM None of your e-mail accounts could send to this recipient. This is happening more often that we can stand it. Any ideas what this is and why it is happening? It only happens every now and then not all the time. TYIA Azm ...

Access to public folders from exchange system manager
Hi When using Exchange system manager to access and manage our public folders, we get the following message, error c1030af4, http error 502. Clients can access the folders from within outlook 2000, but we have no access via OWA. Does anyone have any ideas Hey, Check the public folder settings in the IIS. It can be a security error. Razza "designled" <anonymous@discussions.microsoft.com> wrote in message news:9C6DBE83-692D-4242-9923-C48410460DCE@microsoft.com... > Hi, > > When using Exchange system manager to access and manage our public folders, we get the follo...

how do I design next year's calendar in Publisher?
I want to begin designing a 2006 calendar now. How can I do this in Publisher 2002 (Office XP 2002) OS Win XP Home? The template calendar is for the current year & I don't know how to import a different year - say from Outlook, to use within Publisher. Open one of the standard calendars in Publisher and choose Change date range. Then edit for your design. "EmmaJuJu" <EmmaJuJu@discussions.microsoft.com> wrote in message news:AB7D2F2C-1DFB-4E87-B7D9-D3833FF31182@microsoft.com... > I want to begin designing a 2006 calendar now. How can I do this in > Publish...

What is best practice for using one of multiple .dll's
I have an application that uses one of a selection of about five .dll's depending on the user's environment. Each .dll has the same methods and properties but in this case, uses a different video player. The application is a conversion from VB6 where the dll name was read from the registry and a generic object created so the program didn't have to change references to the object's objects and methods... something like: videoPlayer = GetString(HKEY_LOCAL_MACHINE, "Software\Velocedge", "VideoPlayer") Set videoCtl = CreateObject(videoPlayer) ...

IF gone wrong
This is a simple IF statement that I can not get to work: =IF(4000<$F59<9000,"BETWEEN","NOT BETWEEN") No matter what I put in F59, e.g. 5000 I only get the output NOT BETWEEN. What am I doing wrong? Thanks. -- Turnipboy ------------------------------------------------------------------------ Turnipboy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24527 View this thread: http://www.excelforum.com/showthread.php?threadid=485823 Hi Try =IF(AND($F59>4000,$F59<9000),"BETWEEN","NOT BETWEEN") Regards Roge...

Path to user's desktop
I want to have an app default to saving its data files to the desktop if the user doesn't specify otherwise, or specifies a non-writable location. Is there a function or recommended registry entry that provides the path to the user's desktop? I found what looks like a what I want in the registry, fully spelled out in a REG_SZ: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. The "Desktop" value contains "C:\Documents and Settings\myusername\Desktop", which is my current desktop folder. It also is available as a REG_EXPAN...

Input stream to output stream?
Hi - More newbie questions ... I have been trying to understand the C++ streams concept, and trying to look at the standard template library source code gives me massive headaches, so I have to ask: should this code: ------------------------------------------- ifstream srcProjectFile(szSrcFile, ios::in) ofstream destProjectFile(szDestFile, ios::out) .... various processing ... destProjectFile << srcProjectFile; ------------------------------------------- .... copy the rest of srcProjectFile into destProjectFile ? Ok, I know the answer: it doesn't, although it *does* give wri...

Media Player in Windows 7 wont play ripped cd's
I have rippped or copied music from cd's i have bought so that i can create playlists etc and listen to music on my new pc but it wont play them, it comes up with error msg and then a link to a microsoft website to intall a license and that also produces an error msg so i cannot find any solution to this ...

Keep POP mail out of Exchange's Sent Items
We use Exchange 2003 and Outlook 2003 for email. I got tired of going to my personal ISPs webmail site any time I wanted to send/receive email without it going thru my Exchange server, so I just created a .pst file, set up my POP account in Outlook, and created a rule to move all mail from that account to a folder in the .PST file. Unfortunately, I apparently can't create a similar rule for outgoing mail? I just sent a test email using Outlook, making sure to select the POP account as the account to send the message thru. However, it still showed up in the Sent Items folder in m...

When printing page to pdf, my Excel XY chart shrinks to one half s
Quick question for the MVPs, like Jon P. and others. I have an Excel page with six dense XY graphs. But, each of these graphs are actually a picture of an XY graph from another page within the same workbook--it is a summary sheet. The problem is that whenever I print that summary page to pdf, the pdf software cuts down the height of each graph to exactly 1/2 the size. I have used CUTEpdf Writer and Acrobat Pro, and both of them do this. Moreover, after printing, the summary page, the "picture" graphs in the Excel file also show the same reduction in size. Do any of you...

Unable to add Outlook's Inbox to IE 6.0's Favorites folder...
Does anyone know how to do this procedure, so I can access my Inbox with IE's interface, for faster access, as it were? Thanks... -- AKS ksteen2553@charter.net wrote: > Does anyone know how to do this procedure, so I can access my Inbox with > IE's interface, for faster access, as it were? Thanks... It's called Outlook Web Access and AFAIK you can't use it unless you have Exchange Server..... -- Registered Linux User no 240308 Kubuntu 6.06, Open Office 2 gordonDOTburgessparkerATgbpcomputingDOTcoDOTuk to email me remove the obvious! Gordon: Thank you for replying;...

Does changing a user's default Internet address mean you should uncheck "Automatically update e-mail addresses based on the recipient policy"?
Hello, We have a lot of users with multiple family names, e.g., John Smith- Doe. The Internet address generated by the standard recipient policy is very often not what they want, e.g., they want john.smith@company com or john.doe@company.com but not john.smith-doe@company.com. When that happens, we just manually edit the Internet address in ADUC. My question is: if we change the address generated by the default recipient policy, is it best-practice to then also uncheck the "Automatically update e-mail addresses based on the recipient policy" option box? If we leave it...

Switching OS systems
I know a lot of people probably like Windows 7 by now but its given me several headaches and I certainly checked before installing Windows 7 for incompatibilities ... I won' get in to my petty probs though. What I want to do is switch from Windows 7 back to Vista allthough I did not create a windows.old file whie installing Win7. If I was to copy my WHOLE C Drive to another hard drive and ran the vista recovery disk I assume I would be at day one with the Vista operating system back on the computer. The question is: Can I copy the full C Drive from the standby computer on ...

Text file from mainframe system
We are working on extracting a data file from an IBM mainframe system to merge it into a .csv Excel file. The options for saving the file are either ASCII or carriage- return indicator at the end of each line. What is Excel looking for at the end of each line for it to merge the data into the spreadsheet correctly? We have tried both options and it merges all info into one row. How are you merging your data into excel? For most DOS/windows programs, the end of line character is crlf (carriage-return/Line-feed). It's really two different characters (hex 0D, followed by hex 0A)....

Operator's Manual Template
I'm working on an operator's manual for a fire truck. I have it in Word. There are 11 sections. I have a table of contents and figures. I'm looking for a template for Publisher or Word to dress it up and make it more managable. You could start here. http://office.microsoft.com/en-us/templates/default.aspx "jholland" <jholland@discussions.microsoft.com> wrote in message news:8B3961CE-0E5D-44A8-9D8D-8E2C67A5F178@microsoft.com... > I'm working on an operator's manual for a fire truck. I have it in Word. > There are 11 sections. I have a table o...

Window's App specific Volume slider
This probably isn't the right group to ask, but it is a VB6 app I'm having this issue with and I can't think of anywhere more appropriate. The problem I'm having is with a VB6 App that features video clip, audio clip, and DVD playback with volume controls. The volume sliders my app implements are simple VB slider controls adjusting the volume of either a directshow audio object or an MCI API audio channel. My issue doesn't have anything to do with these though, the problem I'm having is with the volume slider that Windows (Vista and 7) automatically genera...

Opening other user's folder #2
I have set up outlook to open other user's folders. There are some people who have left the dept. and I'd like to remove them from the Other User's Folder pull down menu. I've removed full mailbox access using ADUC, but want to remove the "other user's" name from the display without creating new outlook profile. Any solutions to this? Registry setting? thx See http://www.slipstick.com/outlook/usertips.htm#otherusers for information on what changes to make in the registry to clear the "open other user's folder" history. -- Sue Mosher, ...

OWA
I have full permissions to other users' mailboxes, and can access them in Outlook, but when I try in OWA I receive the error "You are not authorized to view this page." The way I try to access the another user's mailbox is by appending /[email alias]/inbox. (I've also tried multiple combinations of substituting email alias with user logon name and keeping/dropping "inbox.") This worked at one time, but I haven't tried it in a while. So either some updates I have applied to my server (sbs 2003 premium - running Exhange 2003) or some other configuration ch...

Mails stuck in "vsi 1\Queue" folder
Hi! I am currently tracing an Exchange queue issue that I cannot figure out myself. We are running Windows 2003 SP2 Exchange 2003 ENT SP2 - but periodically emails are stuck in the "vsi 1\Queue" folder on the disk. However, the messages doesn't appear in the "Queue" view in the Exchange System Manager - and all Exchange logs (Transport + SMTP) says that the emails have been delivered correctly to all receipients - although in rare circumstances certain receipients doesn't receive the emails either. The problem seem to have been minimized after applying Windows 20...

changing passwords on system account
We have been requested to set our exchange service account from password never expires to user must change password at next logon. We are running in mixed mode with several exchange 2000 servers and a couple exchange 5.5 servers. Also, we have been requested to make the same change on the systemmailbox accounts that are created with each store. If we change those accounts to user must change password at next logon, what will happen if anything to the exchange 2000 servers, the exchange 5.5 servers and to any or all of the stores. Thanks - Mike Mike, If I understand you correctly it...

Viewing someone else's meetings
When you right click on a contact and select "Schedule a meeting", then you see their calendar and meeting they have scheudled, can they tell that you have just viewed the items? I have not set up anything, just viewed their calendar entry. Any suggestions on if they are notified? No. They are not notified. -- Regards Judy Gleeson MVP Outlook www.judygleeson.com www.deskdoctors.com Are you sick of bad email practice? Get a copy of my paper "Implementing Email Policy" from the Desk Doctors website. "Curious" <Curious@discussions.mic...

Streaming Database
What is Streaming Database (.stm) file ? what is the use of it ?? When exchange server receive messages from the Internet, instead of converting to MAPI format, it stores them in the .STM file in their native or raw format. STM files don't have indexes but pointers to them are created in the .EDB file. Also in STM file there is no indication to which mailbox each item belongs to. Hence when restoring EDB files, it must have matching STM file otherwise it will not work. Hope this will explain. "Dragon" wrote: > What is Streaming Database (.stm) file ? > what is t...