Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Non-negative number required. Parameter name: byteCount

Thread Tools

Non-negative number required. Parameter name: byteCount

Posts: n/a
How can this issue be resolved (in the subject). bytecount is not a
parameter in my functions. I read from some other groups that this is
related to the IP change whil the transactions take place. Any solution for

Reply With Quote
Steven Cheng[MSFT]
Posts: n/a
Hello James,

From your description, you're getting the following error when calling a
certain ASP.NET webservice.

<Non-negative number required. Parameter name: byteCount>

As for the this problem, I'd like to confrom the following things:

1. Are you getting this error at client-side (webservice proxy)

2. Is your ASP.NET server service built on ASP.NET 1.1 or 2.0?

Based on my research, the error message you were getting "Non-negative
number required. Parameter name: byteCount" is basically a known issue in
our error handling code in .NET 1.1 framework. Here is the detailed
description on this:


The server is returning a response to the client. This response was an HTTP
response, so the .NET framework will process this expecting a normal soap
The problem however is that the content (or error message) returned from
the server
had a content type of '' instead of 'text/xml', which is what we expect for
soap 1.1 protocol, or if you were using soap 1.2 protocol we would have
the content type of 'application/soap+xml'.

At the point when we see this incorrect content type we try to raise an
InvalidOperationException with the message text of client found response
type of '{0}', but expected '{1}' where we'd replace the place holders with
values we found and expected respectively. We call some internal methods
that tries
to read the response stream but we have a bug which passes a negative
number into
the number of characters we are to read so we get the failure within

Curerntly what I've found is a workaround here:

- Get a network trace of the failing response
- Analyze the response to find out if the server is simply sending an HTTP
packet with an error web page or message.
- Take actions on the error message that the server is sending, not on what
client is getting while trying to parse the servers error message.


Steven Cheng

Microsoft MSDN Online Support Lead


Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at


This posting is provided "AS IS" with no warranties, and confers no rights.

Reply With Quote
Steven Cheng[MSFT]
Posts: n/a
Thanks for your reply James,

Yes, currently, for this issue we may need to manually inspect the
server-side error and try avoiding it. BTW, since this is a known issue
recorded, if you want a thorough solution such as a hotfix for your
particular scenario, you can directly contact CSS for further assistance on

In addition, you're welcome to submit any request or feedback to our
product feedback center so that the dev team can hear more on this:

Again, thanks for your posting.


Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PPP session bytecount in syslog? Rob Cisco 0 01-29-2010 02:08 PM
without declare parameter [double square(parameter)] return 0 in main C Programming 5 10-01-2008 03:31 AM
Using declaration inside first template parameter as default valuefor second template parameter. Stuart Redmann C++ 5 12-14-2007 08:42 AM
Parameter List / Parameter Block / Anything patterns... C++ 4 03-29-2007 09:37 PM
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM