以下是VS2012中新WCF服務應用程序的web.config的默認佈局。關於默認WCF項目web.config佈局的混淆
讓我感到困惑的是,它似乎不匹配任何在線示例或教程。沒有定義端點或綁定,但可以調用該服務。
我試圖增加MaxReceivedMessageSize屬性時遇到問題 - 我使用了它,並沒有線索在哪裏查看我的web.config。
有人能指出我爲什麼這麼奇怪的佈局正確的方向?
我期望它看起來更像This SO question about setting MaxReceivedMessageSize,甚至像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>
感謝蒂姆。我使用一些舊式手動聲明所有內容,並將其設置在那裏,工作得很好:) – NibblyPig