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 8285885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:34:31+00:00 2026-06-08T11:34:31+00:00

I have a webapi public ISearchProviderCommandResult ExecuteCommand(ISearchProviderCommand searchCommand) { //serialize the object before sending

  • 0

I have a webapi

public ISearchProviderCommandResult ExecuteCommand(ISearchProviderCommand searchCommand)
{
  //serialize the object before sending it in
  JavaScriptSerializer serializer = new JavaScriptSerializer();
  string jsonInput = serializer.Serialize(searchCommand);

  HttpClient httpClient = new HttpClient() { BaseAddress = new Uri(ServiceUrl), MaxResponseContentBufferSize = 256000 };

  StringContent content = new StringContent(jsonInput, Encoding.UTF8, "application/json");

  HttpResponseMessage output = httpClient.PostAsync(ServiceUrl, content).Result;

  //deserialize the output of the webapi call
  SearchProviderCommandResult searchResult = serializer.Deserialize<SearchProviderCommandResult>(output.Content.ReadAsStringAsync().Result);

  return searchResult;
}

on my local machine whether I set the MaxResponseContentBufferSize or not, it seems to retrieve data the way I want it. However on our build environment, If I dont set the MaxResponseContentBufferSize , I get this error:
Cannot write more bytes to the buffer than the configured maximum buffer size: 65536.

After looking on google, I decided to set the MaxResponseContentBufferSize to an arbitrary 256000 value. Even though this works on my local machine, on the build box I get this error:
Method not found: ‘Void System.Net.Http.HttpClient.set_MaxResponseContentBufferSize(Int64)

I have no idea what to do now.

  • 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-06-08T11:34:33+00:00Added an answer on June 8, 2026 at 11:34 am

    Look at this thread on forums.asp.net. It seems there is some issue with .net 4.5 beta version on your build environment. There is surely a mismatch of dlls on your local and your build environment

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

Sidebar

Related Questions

I've created a method using the new WebAPI features in MVC4 and have it
I have a webapi project with a base ApiController named SlashBaseService: [RouteArea(uBase)] public abstract
I have webapi controller with 2 action methods like so: public List<AlertModel> Get() {
I have an object that's being automatically serialized by the WebAPI, but I wanted
I have the following action in my ASP.NET Web API: public IEnumerable<Car> carssOfUser(int id,
Let say I have two methods in MVC 4 Web API controller: public IQueryable<A>
I have MVC webApi application which works with Unity . I have to resolve
I have a desktop webapi server that I want to expose to clients through
I have a Asp.net WebAPI service that is hosted on AppHarbor which throws 404
I have a layered web application that I built with ASP.NET MVC 4, WebAPI

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.