Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7678389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:38:08+00:00 2026-05-31T17:38:08+00:00

We have an issue where on a single instance of our product we receive

  • 0

We have an issue where on a single instance of our product we receive an InvalidOperationException exception when we attempt to set the ReadTimeout property of an System.Net.HttpWebResponse object.

This issue is occurring only on a single instance, where we have many multiple live sites without this problem. We’ve tried to recreate the issue locally, to no avail.

The following code illustrates the issue.

Any ideas are greatly welcome.

Thanks

    private static XmlReader GenerateReaderFromResponse(HttpWebResponse response, HttpWebRequest request)
    {
        Stream responseStream = response.GetResponseStream();
        responseStream.ReadTimeout = request.Timeout; //This is where the exception is generated - System.InvalidOperationException: Timeouts are not supported on this stream.

        using (StreamReader responseReader = new StreamReader(responseStream, System.Text.Encoding.UTF8))
        {
            XmlReaderSettings readerSettings = new XmlReaderSettings();
            readerSettings.ProhibitDtd = false;
            string responseContent = responseReader.ReadToEnd();
            return XmlReader.Create(new StringReader(responseContent), readerSettings);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:38:10+00:00Added an answer on May 31, 2026 at 5:38 pm

    What you need is the HttpWebRequest.ReadWriteTimeout property.

    It specifies the number of milliseconds before the reading (or writing) operation on the response Stream times out, throwing a WebException with Status set to WebExceptionStatus.RequestCanceled.

    From the msdn documentation:

    The ReadWriteTimeout property is used when writing to the stream
    returned by the GetRequestStream method or reading from the stream
    returned by the GetResponseStream method.

    Specifically, the ReadWriteTimeout property controls the time-out for
    the Read method, which is used to read the stream returned by the
    GetResponseStream method, and for the Write method, which is used to
    write to the stream returned by the GetRequestStream method.

    To specify the amount of time to wait for the request to complete, use
    the Timeout property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have another issue here. Our app starts out with a tab activity. But, before
i am using a single instance of Bugzilla for issue tracking in multiple projects.
Problem: In our organization we have a home grown single-sign-on app written in c#/.Net2
I am having an issue while accessing single database instance using multiple/distributed Hibernate SessionFactories
I have issue with: <form:checkboxes path=roles cssClass=checkbox items=${roleSelections} /> If previous line is used
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR
Share your ideas please! I have issue to check the folder and convert a
Have an issue with marshall and unmarshall readers and writers. So here it is.
I have an issue with jquery and history.back(): I got a link: <a href=#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.