【发布时间】:2013-06-26 03:27:40
【问题描述】:
我有一个超级简单的 WCF 服务。我使用 IIS7 在我的本地机器上托管它。
当我向我的服务添加服务引用时,Visual Studio 告诉我有一个错误。我可以单击详细信息链接,然后会弹出一个对话框:对象引用未设置为对象的实例。
我可以毫无问题地构建我的 WCF 服务,并且我的客户端应用程序也成功构建。
我什至可以使用 svcutil http://localhost/logservice/logservice.svc?wsdl 来生成客户端。
我在我的 Windows 事件日志/查看器中看到了这个错误:
.NET 运行时版本 2.0.50727.3053 - 致命的执行引擎错误 (706B7706) (80131506)
我在网上找到了一个修补程序,但无法安装...
我认为这与我添加服务引用的客户端解决方案有关。我可以使用“在解决方案中发现服务”功能添加服务参考。我只需要在其他地方的解决方案中添加一个服务引用,所以这让我发疯了。
我的 web.config 的 system.serviceModel 如下所示:
<system.serviceModel>
<services>
<service behaviorConfiguration="LogServiceBehavior" name="LogService">
<endpoint address="" binding="wsHttpBinding" contract="ILogService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="LogServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
【问题讨论】:
-
我不明白这是怎么跑题的。
标签: wcf