none
Remote Debug into a WCF service

    问题

  •  

    Hi

        I am trying to Remote Debug into a WCF service ( Visual Studio 2010 ) ,
        deployed on IIS (7.5.7600.16385) , Windows 2008 R2 Enterprise.

        The  WCF service is using port 81.

        The Remote Debugger Window shows that I made the connection.  

        This is the error that I am getting :

        Unable to automatically step into the server.Connecting to the server machine 'xxx.xxx.x'.

        Please instal Visual Studio 2010 Remote Debugger on the server.

       Visual Studio 2010 Remote Debugger is present on the Remote Server and
       I have started the service.I have also opened the TCP ports 135/139/445 and UDP 136/137 , 500 and 4500.   The Web.config file has "debug=true".

      Please help me find a solution to this problem.

    Thanks,

    Thahseen


    2012年3月15日 16:23

答案

  • Hi,

    You need to set your symbols path. In VS2010, on the menu, Debug->Options and Settings. The Options window will appear. Under the Debugging treeview item there is an item called Symbols. Set the path of your PDB file here.

    Also, from memory, You can copy the PDB file locally and set the symbol path to the local PDB file.



    2012年3月17日 2:04

全部回复

  • This is a step by step guide on how to setup remote debugging.

    If you have followed the steps and still have problems or if you solve the problem let me know
    http://msdn.microsoft.com/en-us/library/bt727f1t.aspx

    2012年3月15日 16:44
  • Hi

        I did follow these steps. Still not working.

    Thanks,

    Thahseen

    2012年3月15日 16:51
  • On 3/15/2012 12:23 PM, Thahseen Mohammed wrote:
    > Hi
    >
    > I am trying to Remote Debug into a WCF service ( Visual Studio 2010 ) ,
    > deployed on IIS (7.5.7600.16385) , Windows 2008 R2 Enterprise.
    >
    > The WCF service is using port 81.
    >
    > This is the error that I am getting :
    >
    > Unable to automatically step into the server.Connecting to the server
    > machine 'xxx.xxx.x'.
    >
    > Please instal Visual Studio 2010 Remote Debugger on the server.
    >
    > Visual Studio 2010 Remote Debugger is present on the Remote Server and
    > I have started the service.I have also opened the TCP ports 135/139/445
    > and UDP 136/137 , 500 and 4500. The Web.config file has "debug=true".
    >
    > Please help me find a solution to this problem.
    >
    > Thanks,
    >
    > Thahseen
    >
     
    Well, you should have the client and the WCF Web service projects in the
    same solution -- one .sln file,  and you consume the service from the
    client that way. You will be able to debug that way and step into the
    WCF Web service-side code from the client-side code.
     
    If you are using VS2010 Professional as an example, then VS2010 is going
    to stop in the debug session and present a dialog box asking do you want
    to attach to the ASP.NET Worker process w3wp.exe that is hosting the WCF
    Web service if you are in debug mode in the IDE the first time you
    access the Web service.  All ASP.NET applications are hosted by the
    w3wp.exe program.
     
    The WCF client and service applications must be running on the same
    machine to debug the client and the service in the VS IDE. With the
    traditional way that can still be used  and in debug mode,  you will set
    a breakpoint on the client side code, you go to the Debug menu option,
    go to the Attach to Process option and you attach to the w3wp.exe
    process, set a breakpoint in the service side code, and hit F5. The IDE
    is going stop at the breakpoint on the service side or you single step
    into code from the client side to the service side in debug mode.
      
    2012年3月15日 17:02
  • Thanks.. I read the article.Doesnt seems like I have missed any of the steps. I was able to successfully debug on a 32 bit , Windows 2003 server with IIS6.0. We then moved to Windows 2008, IIS7.0, 64 bit. The  WCF service works. Only the remote debug part is not working.

    2012年3月15日 17:07
  • Hi

        I am attaching the W3WP.exe process and my service is running on a remote machine. So, running client and service on same machine is not an option for me.

    Thanks,

    Thahseen

     

    2012年3月15日 17:11
  • The server is 64bit. How many bit is the machine that is trying to debug the service? 

    2012年3月15日 17:21
  • The client machine is also 64 bit , Windows 7.
    2012年3月15日 17:23
  • On 3/15/2012 1:07 PM, Thahseen Mohammed wrote:
    > Thanks.. I read the article.Doesnt seems like I have missed any of the
    > steps. I was able to successfully debug on a 32 bit , Windows 2003
    > server with IIS6.0. We then moved to Windows 2008, IIS7.0, 64 bit. The
    > WCF service works. Only the remote debug part is not working.
    >
     
    Things would be a lot simpler if it was done locally. Doing the
    debugging of a WCF service Web or otherwise is a lot simpler when the
    client and service are on the same machine.
     
    2012年3月15日 17:53
  • This is true darnold924. Although sometimes the production and development environments are far from similar it can be a frustrating series of events for a developer to find that something works in development and not in production. So being able to debug remotely can be a life saver.

    Thahseen, have you tried putting the remote computer name in the Properties->Debug tab of Visual Studio (You can do this rather than attach to process)? I assume you are using VS2010?

    2012年3月16日 1:29
  • Hi rupex

         Yes I am using VS2010. I tried your suggestion, using the Debug tab, instead of attaching the process.  The Service call didnt fail, but it did not step into the code of the WCF method. The output window of VS gave me these messages :

    Step into: Stepping over method without symbols 'System.ServiceModel.ClientBase<WindowsFormsApplication1.IISYds02.IWCFDbServiceContract>.Channel.get'

    Step into: Stepping over method without symbols 'System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke'

    The pdb files are present along with the WCF service dlls.

    Thanks,

    Thahseen

    2012年3月16日 15:00
  • Hi,

    You need to set your symbols path. In VS2010, on the menu, Debug->Options and Settings. The Options window will appear. Under the Debugging treeview item there is an item called Symbols. Set the path of your PDB file here.

    Also, from memory, You can copy the PDB file locally and set the symbol path to the local PDB file.



    2012年3月17日 2:04
  • Hi

         I copied the pdb s  locally and the output window said that the symbols were loaded. But I am still getting my initial error :

        Unable to automatically step into the server.Connecting to the server machine 'xxx.xxx.x'.

        Please install Visual Studio 2010 Remote Debugger on the server. Thanks,

    2012年3月22日 13:33
  • Are you connecting using attach to process or through Visual Studio?

    Are you not getting this message anymore:

     

    Step into: Stepping over method without symbols 'System.ServiceModel.ClientBase<WindowsFormsApplication1.IISYds02.IWCFDbServiceContract>.Channel.get'

    Step into: Stepping over method without symbols 'System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke'

    2012年3月22日 13:50
  • Yes.. I used Attach to process meathod.

    Yes.. I am not getting the Stepping over without symbols anymore.

    Thanks,

    Thahseen

    2012年3月22日 13:59
  • Can you try using Visual Studio through Properties->Debug. On the debug Tab select 'Use remote machine'.

    Only when you start debugging load your symbols then. I have found sometime that the symbols don't load until you are acually debugging.

    Let me know how you go :)

    2012年3月22日 14:05