关于 error: Operation is not valid due to the current state of the object。

今天碰到一个特别的异常。

Operation is not valid due to the current state of the object.

at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()
at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding)
at System.Web.HttpRequest.FillInFormCollection()

后来发现,客服端post过来的参数,传过来一大堆不用的,但感觉也不应该会抛异常啊。

后来把参数纠正后(减少了很多post过来的参数),就正确了。

但不甘心,又网上搜索了下,查到如下解决方法:

<configuration>
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="5000" />
  </appSettings>
</configuration>

开来FillInFormCollection,是有个数限制的。以后得多多注意。

时间: 2024-12-27 02:57:00

关于 error: Operation is not valid due to the current state of the object。的相关文章

URL-encoded form data is not valid ,Operation is not valid due to the current state of the object

System.Web.HttpUnhandledException: 引发类型为"System.Web.HttpUnhandledException"的异常. ---> System.Web.HttpException: URL 编码窗体数据无效. ---> System.InvalidOperationException: 对象的当前状态使该操作无效. 在 System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKey

Operation is not valid due to the current state of the object.

昨天客户突然要求将某个角色的所有权限都不分页的放在一个页面修改,本地测试OK,通过:但发布后,点击该页面提交后一直报下面的错误: 异常信息: Operation is not valid due to the current state of the object.错误源:System.Web堆栈信息:   at System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()   at System.Web.HttpVa

JavaScriptSerializer 序列化时异常:Operation is not valid due to the current state of the object.

异常详情: System.InvalidOperationException: Operation is not valid due to the current state of the object. at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) at System.Web.Script.Serialization.JavaScriptObj

kali kvm Requested operation is not valid: network &#39;default&#39; is not active

今天安装完kvm,满是幸福的装了个xp,重启后出现了一个错误 Requested operation is not valid: network 'default' is not active 详情: Details: Error starting domain: Requested operation is not valid: network ‚default‘ is not active Traceback (most recent call last):File „/usr/share/

maridb Error &#39;Operation DROP USER failed for

数据库版本:mariadb   10.0.12 主库删除多余的用户名,因从库没有此信息造成主从故障! 报错信息如下:Error 'Operation DROP USER failed for 'username'@'192.16.%' 多源复制的主从报错跳过: 根据mysql操作方式sql_slave_skip_counter = 1 ,执行不报错,但是sql_slave_skip_counter = 1 不会生效 多源主从跳错的操作如下: SET @@default_master_connec

yum 报错 Error: Cannot find a valid baseurl for repo: base

环境: vmware OS:CentOS release 6.5 双网卡 Eth0(接公网 192.168.80.0),Eth1(接内网 192.168.44.0) 报错: 使用YUM更新软件时报错 Error: Cannot find a valid baseurl for repo: base 之前使用YUM一直没有问题,今天重启了虚拟机后yum就不能使用了.这个报错是DNS解析引起的,检查/etc/resolv.conf ,DNS 变成 192.168.44.1,手动修改后,使用yum正常

cmake error(1): cmake_symlink_library: System Error: Operation not supported

cmake_symlink_library: System Error: Operation not supported 1/创建链接不成功,要确认当前帐户下是否有权限在编译的目录中有创建链接的权限 我使用vmware,在win7机器的共享目录中编译,无法创建链接,就会提示上面的错误. 解决办法是,把源码复制到linux的本地目录中,比如/home等,在本地目录中编译就不会有这个问题.

Pycharm报错解决:error:please select a valid Python interpreter

问题描述: 之前PC上安装的是Python2,后来工作需要转成Python3了.然后在用pycharm运行Python2的程序时发现源程序运行报错(出去语法错误) error:please select a valid Python interpreter 问题原因: 在pycharm导入源项目的时候没有选择运行Python的程序 解决办法: 1.更改Pycharm的设置 打开settings(CTRL + ALT + S)或者file>settings,打开配置框,如下图: 2.在查询框中输入

Oracle EBS 提示XX对当前用户不可用--XX is not a valid responsibility for the current user

Oracle EBS 提示XX对当前用户为不可用职责--XX is not a valid responsibility for the current user 最近在EBS中添加新职责进行切换没问题,但是要进入相关职责的Form或Web页面则会碰到如图的难题.解决方法是这样的. 1. 进入Functional Administrator职责. 2. 选择Core Services->Caching Framework->Global Configuration. 3. 分别Clear Al