简体   繁体   English

在后面的代码中获取最大数组长度配额…C#

[英]Getting the maximum array length quota in code behind…C#

This is an MVC3 app. 这是一个MVC3应用程序。 I have read and read and read but i cant figure this out. 我已经阅读并阅读,但我无法弄清楚。 I am getting the max array length quota error when trying to upload a file to my server. 尝试将文件上传到服务器时,出现最大数组长度配额错误。 I have gotten this before in my app, and fixed it by increasing it in the web.config. 我之前在我的应用程序中已经获得此功能,并通过在web.config中增加它来修复它。

  <readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
                    maxArrayLength="2147483647" maxBytesPerRead="4096" 
                    maxNameTableCharCount="2147483647"/>

Now im uploading documents via old school asmx services(because i have to, not my decision). 现在,我通过老式的asmx服务上传文档(因为我必须这样做,而不是我的决定)。 I call the asmx services via WCF and i get the max quota error. 我通过WCF调用了asmx服务,并且得到了最大配额错误。 I can download files that have I uploaded the previous way i was uploading them (stream objects via WCF). 我可以下载以前上传文件的方式上传文件(通过WCF流​​对象)。 So my question is not how do I fix this by changing values in config files, but how do i programatically get the max array length in C#. 因此,我的问题不是如何通过更改配置文件中的值来解决此问题,而是如何以编程方式在C#中获取最大数组长度。 I wanna see what it is while i'm debugging. 我想查看调试时的状态。 Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM