Request Entity Too Large for Self Hosted ASP.Net Web API在Selfhost的api后台怎么解决Request Entity Too Large问题

如果用的IIS承载api,可以在web.config中添加配置来解决

<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
<httpRuntime
maxRequestLength=""
executionTimeout="" />
</system.web>

但在Selfhost中App.config没办法添加此配置

正常的添加方法应该在添加selfhost绑定配置项时添加

var config = new HttpSelfHostConfiguration(host);
config.MaxReceivedMessageSize = ; // use config for this value
/*
other setup for the config
*/
using (var server = new HttpSelfHostServer(config))
{
server.OpenAsync().Wait();
Console.WriteLine("Insight.Web");
Console.ReadLine();
}

最新文章

  1. MySQL开启慢查询 总结
  2. 20145212 《Java程序设计》第7周学习总结
  3. iOS 使用COPY声明NSSTRING属性
  4. 命令cd
  5. 安全管理:IE6安全隐患重重 为何不离不弃
  6. opencv实现连通域
  7. 转:Web 测试的创作与调试技术
  8. Shiro眼皮下玩ajax,玩出302 Found(实践得经验)
  9. 瑞芯微RKnanC芯片处理器介绍
  10. 【常见错误】--Nltk使用错误
  11. Dubbo常用配置解析
  12. mysql5.7基于gtid主从重做
  13. npm 命令
  14. Centos rpm包安装PHP所需包
  15. PXE:偷梁换柱,成功 启动 centos live
  16. 二分查找、two points、排序
  17. 022 Spark shuffle过程
  18. easyui confirm提示框 调整显示位置
  19. LeetCode 112 Minimum Depth of Binary Tree
  20. Qt解析Json数据

热门文章

  1. [Spring MVC] - JSON
  2. T-SQL中的随机数
  3. Python入门3
  4. bzoj1904: Musical Water-fence
  5. &lt;&lt;redis设计和实现&gt;&gt;读书笔记
  6. IQueryable,IEnumerable,List相互转换
  7. C#动手实践:Kinect V2 开发(2):数据源工作原理及红外源Demo
  8. CentOS 下 sftp 有人能连有人不能连 程序设定了禁用IP
  9. email
  10. parse output