我拿起了一个几个月没有碰过的项目我用这个项目来学习 WCF,当我在 Visual Studio 中运行它时,它会打开一个页面,允许我获取生成的 WSDL,我可以点击代码的服务。
但是当我查看 Web.config 时,那里几乎没有任何信息:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
没有服务端点或任何东西,但它运行良好(至少在 Visual Studio 中),这是如何工作的?