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

Similar Articles

[PageSpeed] 49

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:

How to lock and unlock the XP system from remote system.
Hi I am writting a program to lock and unlock the remote desptop.For this I need some help related to sending Ctrl+Alt+Del to the remote PC.Can any one help me on the issue. Regards Prashant Sharma Yes. Find something else to do with your time. You keep trying to do something that any decent security system forbids. There is already remote access. See if you can find APIs relating to remote access. But I suspect that you will discover that Windows security is going to make this task impossible. joe On Wed, 18 Apr 2007 15:19:31 +0530, "ISDC" <satish7684@hotmail.com&...

Microsoft Money 2004
I just upgraded from Money 2002 to Money 2004. Can somebody please explain why I just paid AUD$80 for THE SAME SOFTWARE? Very, very disapointed. What information did you rely on to set your value expectation level that M04 was way different, indeed AUD$80 better, than M02? That might help explain it better than we can. "Paul Ward" <pbward@hotmail.com> wrote in message news:04b401c35bb8$b9fea7d0$a501280a@phx.gbl... > I just upgraded from Money 2002 to Money 2004. Can > somebody please explain why I just paid AUD$80 for THE > SAME SOFTWARE? > > Very, very disa...

What's the CreateDialogIndirect() function used for?
Hello, All: I am here having met a problem that my code likes following cannot run out, and when I debugged this,I found that would have a proble at calling CreateDialogIndirect() function in CDialog::CreateDialogIndirect() ,and indeed,it's wrong at BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate, CWnd* pParentWnd, HINSTANCE hInst) function by using a global function like this: // create modeless dialog AfxHookWindowCreate(this); hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, pParentWnd->GetSafeHwnd(), AfxDlgProc); I don't know why it likes this,is ther...

How to impersonate to Local System Account (SYSTEM)
My service is configurated as the Administrators acount. I need to impersonate the service to Local System Account (SYSTEM) in some circumtances. How? Thanks very very much indeed lauch ...

Linking a sheet's content into a Word document
Hi. I have a Word document and an Excel document. Some of the content of the Word document merely duplicates the content of the Excel document. What I would like to do is to set up the Word document so that it automatically retrieves the text from the Excel document. Similar to doing a '=D5' in an Excel spreadsheet, so that it just harvests the contents of a particular cell (in this case, D5) and transplants it to another place. Is there a way to implant text from the Excel spreadsheet (which is in another file) into the Word document, so that it automatically opens the Excel spre...

Wrong characters displays in the task window.
Everytime that I try to type something in the task windows the wrong characters appears. Also when updating information. Already check the language settins all the service packs are there. Windows XP and is Outlook 2002 What can I do!! ...

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...

Integration with legacy systems
Hello there. 've seen there is an integration between Microsoft CRM and MS Great Plains. I need to do a similar integration beetween Microsoft CRM and a local System ERP named Diapason. The customer shoul be created by MS CRM. passed to the ERP. Updated tin the ERP and then updated automatically in the MS CRM. Order born in CRM. When approved, tehy should send to the ERP. The ERP create the invoice and send the invoice to MS CRM. Price list is managed by the ERP, imported in MS CRM and when updated in ERO, should be updated automatically in CRM. Customer are updated in ERP and shou...

Outlook not working on MAC o/s X panther
Hi, I have recently upgraded my mac to o/s X and now outlook will not recognize the MS exchange server, other information is that i am booting up with dual systems o/s 9 and o/s 10 as I need to access email at work, please let me know on how to resolve this problem. Thank you. ...

Trust access to visual basic project in XP systems
we have 2000 OS in some system and XP in some system .Excel in XP system not have checkbox (Trust access to visual Basic Project) for macros . Because of the this i think vb exe which is try to run excel macro are failing. can any one hlep me. This is a setting that each user must change. So I think you'll have to educate the users to change this setting before your VB program can run. kasi wrote: > > we have 2000 OS in some system and XP in some system .Excel in XP system not > have checkbox (Trust access to visual Basic Project) for macros . > Because of the this i...

excel causing system to be in low system resource
Hi all. Whenever i open my excel application, i am always prompted low system resource and have to exit the application. However all my other office applications like word, access work fine when i open them. I face similar problems before and i reinstall excel to solve the problem. Is there a better solution which can solve this problem once and for all? Thks in advance ...

Column total is wrong
I have a column of figures which is the result of multiplied column A x Column B. Column B is a multiplier of .001665. The result is shown to two decimal places. When I total the results in Column B, using formula =SUM(B1:B2), it gives the result as 11.16 instead of 11.15. Can I fix this somehow so it gives the correct total? Example A Formula in B Result in B 3250.00 =A1x0.001665 5.41 3450.00 =A2x0.001665 5.74 Total 11.16 Use rounding on the ...

can all the dowloads ihave in the system can they be moved
Iwant to take all downloads that have failed and all downloads that have errors with them Where would you like to take them? Buckingham Palace? "steve.vickers2010@live.co.uk" <steve.vickers2010@live.co.uk@discussions.microsoft.com> wrote in message news:208855E4-BD3F-4C3D-A817-C0DC8CB6BCF9@microsoft.com... : Iwant to take all downloads that have failed and all downloads that have : errors with them Windows version is...? If you want to delete what you see in Update History, I can tell you how to do that. steve.vickers2010@live.co.uk wrote: > I...

Money User's Guide
I downloaded the trial version of Money 2004 to see if I would actually get some use out of a money management program. I opened the user's guide to get an education but the window isn't big enough to display the full text, meaning I have to use the slide bar to read a full line across the screen. I find this very annoying, especially because I can't change the window size. The maximize button isn't an option nor can I place the cursor on the border of the window and drag it open. Is this just poor planning or is there someway to make the text easily readable? Tha...

What's the best way to toggle between true and false in Excel? Hi all, My excel work involves a lot of toggling between true and false (boolean types) ... and it's very repetitive... Is there a w
What's the best way to toggle between true and false in Excel? Hi all, My excel work involves a lot of toggling between true and false (boolean types) ... and it's very repetitive... Is there a way to select a bunch of cells, and press a key short-cut so that they toggle all at once? Thanks! I can't tell you whether this is a "best way" to do what you want or not, but it is "a way" to do it. It doesn't use a key short-cut, rather it uses a right mouse click. Go into the VB editor and double click on ThisWorkbook in the Project window, then copy/paste...

Total Communications System & MS CRM 3.0
To Anyone: I am trying to find a complete "converged communications" system that has complete integration with MS CRM 3.0 as well as an open API that I can further integrate into my business applications. I am finding a lot of sales pitches but no hard facts and confirmed installs. Can anyone point me ? Anthony DeHart try www.genesyslabs.com ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "Anthony" <Anthony@discussions.microsoft.com> wrote in message news:D009397A-044A-482E-97F8-D2BADC9A6A15@microsoft.co...

A cell appears "######". What's this?
I write down a type, for example "55,000", which is by default a general type. From the menu Format, Cells, Number , I try to make it as an accounting type(in dollars), I press ok and then my type "55,000" disappears and appears a "#####" instead. What is this and how can I correct it? Thank you. Make the column wider, the "#####" means that there is not enough room to display the contents "marlen_athens" wrote: > I write down a type, for example "55,000", which is by default a general > type. From the menu Format, Cel...

File system
Hi I am havimg some problem in booting WindowCE 4.2 . The bootup failed in filesystem 1. can anyone help me how to debug the error or where area in windowce I should zoom into for susch problem The ouput of error message is given below FMD::FMD_Init FMD_ReadSector() ######## BLOCK 10 FMD_ReadSector() ######## BLOCK 10 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c233c78 RA=8c233c00 BVA=04000000 FSR=00000007 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c2169d8 RA=8c216a38 BVA=04000019 FSR=00000003 D...

Import Requisitions Into System For Approval
We have a database of registrants for different events and were hoping it was possible to import certain hotel and other expenditure requests into the requisition system for approval. Is there a way to import this data instead of manually create a requisition in the system, and then to route it for approval. Thanks for your help. Graham ...

Proctecting a cell's formatting
Hiya Is there any way to lock a cell for everything except it's value? have a nicely formatted set of cells, but whenever anything i copy-pasted into them the formatting is overwritten. I still want th values to be pasted, but borders and colour settings should remai constant - effectively, I want to set the cells so that any pastin operation is done as if it was a "paste special"->"Values". Ideas -- F*S ----------------------------------------------------------------------- F*SH's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3635 ...

One question about IXMLDOMDocument's method loadXML
Followed is my code: void CGOPolyline::SetSpecificInfo(LPCTSTR strXMLInfo) { IXMLDOMDocument2 *pDOMDoc; IXMLDOMNode *pDOMNode; if(FAILED(::CoCreateInstance(CLSID_DOMDocument40,NULL,CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument2,reinterpret_cast<void **> (&pDOMDoc)))) { AfxMessageBox("�޷�����DOM����Ӷ��޷�����ʵ����������"); return; } if(FAILED(pDOMDoc->QueryInterface(IID_IXMLDOMNode,reinterpret_cast<void **>(&pDOMNode)))) { pDOMDoc->Release(); return; } _bstr_t bstrXML(strXMLInfo); VARIANT_BOOL varSuccess; pDOMDoc->loadXML(bstrXML,&...

Excel opened a file but did not show it's contents
Hi all, One of my colleagues tried to open an Excel file. Excel opened the file (no error was shown up) but it didn't show the contents of the file. If you have 2 files originally opened in Excel, Excel only shown those 2 file windows in it. The newly opened one disappeared. Have anyone of you came across this before? Any ideas to fix the problem are welcome. TIA el Does this mean you looked under the Window option on the menubar and didn't see all the workbooks that you think you opened? If you could see the name, maybe it's just off the visible screen: Window|Arrange|ti...

using access as a content management system for documents
Hello got a question for you all, I am using access to create a content management solution. initially it seems pretty easy i would create a table for each type of document template. and the fields in the table would be the different sections within the template. the data in the fields would be the content this goes with those specific sections in the document. basically i would have a report that puts all the fields together in the correct order and export that to a word document. here is my problem.. some of my data includes bullet points Bold letter and different colors.. is there anyw...

Exchange system manager on fresh XP SP2 laptop
Hello, How do I get the Exchange 2003 system manager console installed on a freshly loaded XP Service Pack 2 workstation?? It keeps complaining about the NNTP service and .Net Framework 1.1... The frame work IS loaded, but I can't figure out what to do with NNTP.. Troy Sounds like it is trying to install the whole kit and caboodle and not just the management software. It might also be an issue with XP SP2 being unable to connect to the WINS server or to the Exchange server. "Troy Bruder" <N0-Spam-troy.bruder@aptconsulting.com> wrote in message news:OoZAS6UgEHA.34...

How do I get an item's rank?
Hi, Let's say I have 10 merchants selling the same product at different prices. How do I get a vendor's ranking? I'd be passing the stored procedure ProductID and VendorID. And the data comes from a table with three columns ProductID, VendorID, Price where the Price field is smallmoney. -- Thanks, Sam Something like With RankedVendors As (Select ProductID, VendorID, Price, Row_Number() Over (Order By Price) As Rank From <YourTable> Where ProductID = <product you are looking for>) Select ProductID, VendorID, Price, Rank From RankedVendors ...