调试WCF时无法自动进入服务器 [英] Unable to automatically step into the server when debugging WCF
问题描述
我感到恐惧:
无法自动进入服务器。远程过程无法调试。这通常表示在服务器上尚未启用调试。
现在,我一直在阅读,我需要添加
Now, I have been reading that I need to add
<compilation debug="true">
到web.config。
to the web.config .
很好,我的问题是我的WCF服务是一个nettcp绑定托管在Windows进程中。
Fair enough, my problem is that my WCF service is a nettcp binding hosted in a windows process.
我在哪里添加?在Windows服务的app.config中,WCF服务?
Where do I add this? In the app.config of the windows service hostiung the WCF service?
在哪个部分?现在我的Windows服务主机的app.config看起来像这样:
In what section? Right now my app.config for the Windows Service Host looks like this :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="Indexer" behaviorConfiguration="IndexerServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/Indexer"/>
</baseAddresses>
</host>
<endpoint address="net.tcp://localhost:9000/Indexer"
binding="netTcpBinding"
bindingConfiguration="Binding1"
contract="WCF.IIndexer" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="Binding1"
hostNameComparisonMode="StrongWildcard"
sendTimeout="00:10:00"
maxReceivedMessageSize="65536"
transferMode="Buffered"
portSharingEnabled="false">
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="IndexerServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
推荐答案
我刚刚遇到同样的问题。为了能够调试WCF服务,您应该在<$ c $中的服务器配置文件中添加< compilation debug =true>
c>< system.web> 部分。
I have just had the same problem. In order to be able to debug a WCF service, you should add the <compilation debug="true">
line in the server's config file inside the <system.web>
section.
有关详细信息,请查看链接:
http://msdn.microsoft.com/en-us/library/bb157687.aspx
For more details, please check the link: http://msdn.microsoft.com/en-us/library/bb157687.aspx
这篇关于调试WCF时无法自动进入服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!