【发布时间】:2012-01-23 18:05:07
【问题描述】:
这是我第一次使用 WCF。开发应用程序非常容易,但是部署在 IIS 上让我抓狂。
我已经尝试了一切来部署它,但是客户端开始将未经授权的用户异常(或类似的东西)抛出给未定义的异常(在 web.config 文件和 app.config 文件进行了无数次更改之后)。
我回到了在 VS (cassini) 中可以正常工作的默认配置。
任何快速指针或详细教程的链接将不胜感激。
提前致谢
<system.serviceModel>
<services>
<service behaviorConfiguration="MBTService.Service1Behavior"
name="MBTService.MBTService">
<endpoint address="" binding="wsHttpBinding" contract="MBTSTBO.IMBTService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MBTService.Service1Behavior">
<!-- 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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
【问题讨论】:
-
@Davide Piras - 我看过那个教程,但对我帮助不大。
-
如果部署在 IIS (Windows Server 2008) 上,您必须先安装 WCF ... 控制面板 > 服务器管理器 > 添加功能 > .NET {版本} > WCF ... 打开 HTTP和 WCF 的 NON-HTTP 选项...根据您的 web.config 中 HTTP 与 HTTPS 设置的复杂性,还有 7 多个差异
-
.. 如果您对此有真正的具体问题,请随时通过 yahoo dot com 的 wcfguy 给我发电子邮件 .. 虽然我要到晚上才会查看我的电子邮件
-
@MacGyver 我正在 Windows 7 上部署,是的,我已经安装了 WCF。事实上,我可以通过在 VS 中添加服务引用来访问它,但是在运行应用程序时会抛出异常:/
标签: c# .net wcf iis deployment