星期一, 一月 17, 2011

Error passing a large variable as a parameter to a remote method

Error passing a large variable as a parameter to a remote method

System.Runtime.Serialization.SerializationException: The input stream is not a valid binary format. The starting contents (in bytes) are: 53-79-73-74-65-6D-2E-57-65-62-2E-48-74-74-70-45-78 ... Server stack trace: at System.Runtime.Serialization.Formatters.Binary.SerializationHeaderRecord.Read(__BinaryParser input)... etc.

The largest byte array I can successfully pass across the wire is 4,193,890 elements in size, as soon as I go to 4,193,891 it bombs out with the above exception.

4193891/1024 is approximately 4096

4096 is the default maxRequestLength for an ASP.NET request to a server. this is the most probable cause...

you can change this behavior in your config file.





useFullyQualifiedRedirectUrl="true|false"
enable = "true|false"
idleTime = "minutes"
maxRequestLength="size in kbytes"
executionTimeout="seconds"
minFreeThreads="number of threads"
minFreeLocalRequestFreeThreads="number of threads"
appRequestQueueLimit="number of requests"
enableVersionHeader="true/false"/>

see http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_aspnetgenref/html/e9b81350-8aaf-47cc-9843-5f7d0c59f369.asp

also,
Large Data Strategies
http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service11072001.asp

Uploading Files Using the File Field Control
http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-fileupload.asp

a search on maxRequestLength yields a handful of others.

没有评论:

发表评论