后续会不断摆出ASP.NET Web.config的各种姿势,欢迎留言补充
1<?xml version="1.0" encoding="utf-8"?> 2 3<!-- 4 有关如何配置 ASP.NET 应用程序的详细信息,请访问 5 http://go.microsoft.com/fwlink/?LinkId=169433 6 --> 7 8<configuration> 9 <system.web> 10 <compilation debug="true" targetFramework="4.0" /> 11 </system.web> 12 13 <!> 14 <system.serviceModel> 15 <bindings> 16 <basicHttpBinding> 17 <binding name="你引用的WebService" maxReceivedMessageSize="2147483647"/> 18 --上面节点,添加maxReceivedMessageSize="2147483647"内容 19 --可解决异常:已超过传入消息(65536)的最大消息大小配额。 20 --若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。 21 </basicHttpBinding> 22 </bindings> 23 <client> 24 <endpoint address="你引用的WebService的地址" ... /> 25 </client> 26 <system.serviceModel> 27 28 <!--指定默认文档 Start 29 Author:JAnnn 30 Time:2015-01-10 31 福利: 32 IIS会自动生成Web.config指定的默认文档, 33 以后就不用手动在IIS里添加了. 34 坑爹: 35 指定默认文档错误的话, 36 Web访问很慢很慢... 37 --> 38 <system.webServer> 39 <defaultDocument> 40 <files> 41 <clear/> <!--添加默认文档前先clear下 避免跟IIS默认文档冲突--> 42 <add value="amap.html"/> <!-- 位于根目录下--> 43 <add value="2.aspx"/> <!-- 找不到1.html 会来找2.aspx--> 44 <add value="x/3.aspx"/> <!-- 位于其他文件夹目录下--> 45 </files> 46 </defaultDocument> 47 </system.webServer> 48 <!--指定默认文档 End--> 49 50</configuration>