下面是 VS2012 中新 WCF 服务应用程序的 web.config 的默认布局。
令我困惑的是,它似乎与任何在线示例或教程都不匹配。没有定义端点或绑定,但可以调用服务。
我在尝试增加 MaxReceivedMessageSize 属性时遇到了一个问题——我用谷歌搜索了它,但不知道在哪里查看我的 web.config。
有人可以指出为什么它的布局如此奇怪的正确方向吗?
我希望它看起来更像这个关于设置 MaxReceivedMessageSize 的 SO 问题,甚至像 Michelle Bustamante 的任何 WCF 教程,这就是我最初学习 WCF 的方式。
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>