Form' threw an exception of type 'System.InvalidOperationException'
环境:VS2017 NetCore 2.2 Razor Layui
在处理异步请求是遇到"((Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest)this.Request).Form' threw an exception of type 'System.InvalidOperationException'
Microsoft.AspNetCore.Http.IFormCollection {System.InvalidOperationException}"
后端代码:

前端代码:

问题发生的原因不请.
在具体使用中发现 前端提交的json最好是放到json解析器中验证一下是否正确,若json不正确这是 FromBody 的数据也会为null.
在这里先记录下来.
Form' threw an exception of type 'System.InvalidOperationException'的更多相关文章
- .net core 3.0web_razor page项目_使用中间件接受大文件上传报错_httpRequest.Form threw an exception of type Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException_Request body too large
前言:在web项目的.net framework时文件上传时,自己常用一般处理程序接受上传文件,上传文件的大小限制是可以项目的webconfig里配置. 到core项目使用一般处理程序变成了中间件 ...
- An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceModel.dll
异常“ An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceMo ...
- (C# Debug)A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll
Debug 模式下运行程序的时候,Output 窗口出来个错误“A first chance exception of type 'System.ArgumentException' occurred ...
- MVC中异常: An exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll的一种解决办法
今天在调试MVC的例子的时候,总是出错(An exception of type 'System.Data.ProviderIncompatibleException' occurred in Ent ...
- Exception of type 'System.OutOfMemoryException' was thrown
最近刚换了服务器,开始测试的时候未发现什么问题,可是一旦同一时间段操作的人比较多的时候,就会抛出如下错误: Server Error in '/' Application. Exception of ...
- System.Security.SecurityException The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception
[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception ...
- System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Stdlib' threw an exception.
08-31 17:02:03: ### DEBUG ##########################System.TypeInitializationException: The type ini ...
- debian The type initializer for 'System.Drawing.KnownColors' threw an exception
Change the "System.Drawing" reference of "CoreCompat.System.Drawing"if you thro ...
- The type initializer for System.Data.SqlClient.SqlConnection threw an exception
The type initializer for System.Data.SqlClient.SqlConnection threw an exception net framwork啥原因 xp电脑
随机推荐
- js中forEach,for in,for of循环的用法详解
一.一般的遍历数组的方法: var array = [1,2,3,4,5,6,7]; for (var i = 0; i < array.length; i) { console.log(i,a ...
- 「HNOI2016」序列
传送门 Description 有 \(q\) 个询问,每个询问给定两个数\(l\) 和\(r\),求 \(a[l:r]\) 的不同子序列的最小值之和 Solution 校内模拟赛用了这道题,但是莫 ...
- [总结] MSF攻击数据库服务
0x01 攻击Mysql服务 1.1 目标探测 auxiliary/scanner/mysql/mysql_version 常用于内网中的批量mysql主机发现: 1.2 爆破登录 auxiliary ...
- koa art-template模板引擎的使用
art-template 模板引擎介绍 art-template 是一个简约.超快的模板引擎. 它采用作用域预声明的技术来优化模板渲染速度,从而获得接近 JavaScript 极限的运行 性能,并且同 ...
- OpenFOAM——运动和静止的同心圆柱之间的流动(库埃特流)
本算例来自<ANSYS Fluid Dynamics Verification Manual>中的VMFL001: Flow Between Rotating and Stationary ...
- forEach, map, filter方法区别
听说for循环已经成了菜鸟标配...? 瑟瑟发抖 赶紧找来资料补一补 1, forEach循环,循环数组中每一个元素并采取操作, 没有返回值, 可以不用知道数组长度 2, map函数,遍历数组每个元素 ...
- 剑指offer:构建乘积数组
题目描述: 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]. ...
- python @classmethod和@staticmethod区别
python 类方法和静态方法区别 python @classmethod和@staticmethod区别 Python中至少有三种比较常见的方法类型,即实例方法,类方法.静态方法.它们是如何定义的呢 ...
- MacOS Laravel 安装教程
一.到官网选择 Laravel 版本 根据个人的喜好选择安装的版本,我选择的是 5.8 https://laravel.com/docs/5.8/installation 以下是 Laravel 5. ...
- mongo 笔记
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options ...