WcF服务

sypwish 2017-04-25 10:56:10


<?xml version="1.0" encoding="utf-8"?>
<configuration>

<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime targetFramework="4.5.2"/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
<system.serviceModel>
<services>
<service name="LoginService.LoginService">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="" contract="LoginService.ILoginService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:56709/LoginService/LoginService"/>
</baseAddresses>
</host>

</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<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">
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
preCondition="managedHandler"/>
</modules>
<!--
若要在调试过程中浏览 Web 应用程序根目录,请将下面的值设置为 True。
在部署之前将该值设置为 False 可避免泄露 Web 应用程序文件夹信息。
-->
<directoryBrowse enabled="true"/>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>

</configuration>






这个是WCF的配置,本机运行的时候 浏览出一整个项目 如下:
localhost - /

2017/4/25 9:54 <dir> App_Data
2017/4/25 9:55 6051 ApplicationInsights.config
2017/4/25 10:00 <dir> bin
2017/4/25 10:00 465 ILoginService.cs
2017/4/25 10:00 7973 LoginService.csproj
2017/4/25 10:00 1166 LoginService.csproj.user
2017/4/25 9:58 119 LoginService.svc
2017/4/25 9:58 661 LoginService.svc.cs
2017/4/25 9:54 <dir> obj
2017/4/25 9:55 923 packages.config
2017/4/25 9:54 <dir> Properties
2017/4/25 9:55 <dir> scripts
2017/4/25 10:33 2486 Web.config
2017/4/25 9:54 1245 Web.Debug.config
2017/4/25 9:54 1306 Web.Release.config

再点击红色字体才可以

是配置不对吗
...全文
500 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangshiyu011 2017-04-25
  • 打赏
  • 举报
回复
纠结这个做什么,WCF本来就是给其他程序调用的,又不是客户直接用浏览器访问的。

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧