Unable to automatically step into the server when debugging WCF

62,855

Solution 1

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.

For more details, please check the link: http://msdn.microsoft.com/en-us/library/bb157687.aspx

Solution 2

First of all, I have this problem in Visual Studio 2015.

If you add a breakpoint on the line that calls WCF Service and press F11 in debug time to go into the WCF code, be aware you MUST add a breakpoint on the first line of WCF Service you are calling.

Solution 3

<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>

Solution 4

I had the same issue. When i checked, my service project was built using .NET Framework 4.5 where was client project was on .NET Framework 4.0

I changed the project properties of service project to have .NET Framework 4.0 and it worked.

Solution 5

Just found a possible resolution. Repair installation as described in this article http://msdn.microsoft.com/en-us/library/bb157687.aspx. (re)installing the VS SP1 will do the trick too.

Share:
62,855

Related videos on Youtube

Matt
Author by

Matt

Hello

Updated on March 03, 2020

Comments

  • Matt
    Matt about 4 years

    I get the dreaded:

    Unable to automatically step into the server. The remote procedure could not be debugged.This usually indicates that debugging has not been enabled on the server."

    Now, I have been reading that I need to add

    <compilation debug="true">
    

    to the web.config .

    Fair enough, my problem is that my WCF service is a nettcp binding hosted in a windows process.

    Where do I add this? In the app.config of the windows service hostiung the WCF service?

    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>
    
  • Patrick Szalapski
    Patrick Szalapski over 10 years
    "add the in the server's config file inside the section." - I'm still not quite sure what to do. What did you mean to write here?
  • Simon Tewsi
    Simon Tewsi over 7 years
    You, sir, are a star. I was going nuts trying to attach to an old asmx web service running in a second instance of Visual Studio 2013. Adding a breakpoint on the first line of the web method that was being called did the trick (by the way, for anyone else with the same problem, both instances of Visual Studio were 2013 in my case).