Mat*_*att 9 .net debugging wcf
我害怕:
无法自动进入服务器.无法调试远程过程.这通常表示尚未在服务器上启用调试."
现在,我一直在阅读我需要添加的内容
<compilation debug="true">
Run Code Online (Sandbox Code Playgroud)
到web.config.
很公平,我的问题是我的WCF服务是一个在windows进程中托管的nettcp绑定.
我在哪里添加这个?在Windows服务的app.config中,WCF服务是什么?
在哪一节?现在我的Windows服务主机的app.config如下所示:
<?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>
Run Code Online (Sandbox Code Playgroud)
我刚遇到同样的问题.为了能够调试WCF服务,您应该<compilation debug="true">在该<system.web>部分内的服务器配置文件中添加该行.
有关详细信息,请查看链接:http: //msdn.microsoft.com/en-us/library/bb157687.aspx
小智 5
<pre>
Add the below in your server config file
(i) Add below in app.config, if you are hosting your WCF service on windows service.
<system.web>
...
...
...
<compilation debug="true" />
</system.web>
(ii) Add below in web.config, if you are hosting your WCF service on IIS.
<system.web>
...
...
...
<compilation debug="true" />
</system.web>
</pre>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
57337 次 |
| 最近记录: |