Breakpoint on a web service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oriane

    Breakpoint on a web service

    Hi,

    I have a .Net Visual Studio solution with one asp.net Web application, which
    uses a Asp.Net Web service. Both are compiled in debug mode, and both are
    using the Studio development web server for debugging. I have also add the
    Web reference to the web service with the "Add Web service in the solution"
    choice, that is the Web app starts the Web service with the Studio
    development web server.

    So I thought I could set breakpoints on the web service C# code. But as soon
    as I start the main web app, the breakpoints are turning yellow with a
    exclamation mark and they don't stop anything.

    Did I miss something ?

    Best regards

  • Jeff Dillon

    #2
    Re: Breakpoint on a web service

    "Oriane" <oriane@noemail .noemailwrote in message
    news:%23gV9spqD JHA.4104@TK2MSF TNGP05.phx.gbl. ..
    Hi,
    >
    I have a .Net Visual Studio solution with one asp.net Web application,
    which uses a Asp.Net Web service. Both are compiled in debug mode, and
    both are using the Studio development web server for debugging. I have
    also add the Web reference to the web service with the "Add Web service in
    the solution" choice, that is the Web app starts the Web service with the
    Studio development web server.
    >
    So I thought I could set breakpoints on the web service C# code. But as
    soon as I start the main web app, the breakpoints are turning yellow with
    a exclamation mark and they don't stop anything.
    >
    Did I miss something ?
    >
    Best regards
    Are they both part of the same solution?


    Comment

    • Oriane

      #3
      Re: Breakpoint on a web service

      Hi Jeff,
      "Jeff Dillon" <jeffdillon@hot mailremove.coma écrit dans le message de
      news:udxwADtDJH A.524@TK2MSFTNG P06.phx.gbl...
      "Oriane" <oriane@noemail .noemailwrote in message
      news:%23gV9spqD JHA.4104@TK2MSF TNGP05.phx.gbl. ..
      >
      Are they both part of the same solution?
      Yes

      Comment

      • Hongye Sun [MSFT]

        #4
        RE: Breakpoint on a web service

        Hello Oriane,

        Thanks for your post. My name is Hongye Sun [MSFT]. It is my pleasure to
        work on this issue for you.

        From your description of the symptom, I understand that It is very easy to
        confuse people when they are developing multiple websites, including web
        service, at the first time. So I will explain the cause and the solution
        from scratch to help you to understand.

        === CAUSE ===
        First let us clarify how the website works. Website including web service,
        they cannot be working individually. Every website of ASP.NET must be
        hosted in a web server process. A web server process in windows is a
        typical windows process. For example, IIS is a web server, which will run a
        windows server process (named w3wp.exe in win2k03) to host websites.

        Next, how can we debug the code of a website? A windows process is the
        basic unit that we could attach debugger to. So if we want to debug on
        website, we should first attach the debugger to the web server process.

        Now let us take a look of how the web server hosts website in Visual
        Studio. In VS 2008, it supports two types of web server. One is IIS and the
        other is built-in ASP.NET Development Server. When one or multiple websites
        are run in IIS, they will be all hosted in IIS service process as we
        mentioned before. If one or multiple websites are run in built-in ASP.NET
        Development Server in Visual Studio, Visual Studio will create built-in web
        server process for each website.
        We can check what type of web server that we are using by opening website
        properties, select "Start Options" in the menu and view "Server" section on
        the right side. If we are using default web server, that means built-in web
        server. Or we are using custom server, that means external web server like
        IIS. By default, it is using built-in web server. For more information
        about web server in Visual Studio, please visit:
        http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx.

        For your scenario, I suppose that your website and web service are all
        hosted by built-in web server. So when you run them, there will be two
        built-in web server processes started by Visual Studio. If you want to
        debug two projects, the debugger should attach to both of the web server
        processes. However, Visual Studio does not know about that. It just
        automatically attaches to startup website's web server process when
        clicking start debugging, while the web server of web service is not
        attached. That's why you cannot debug web service code.

        === SOLUTION ===
        Before starting debugging, please make sure that in Web.config files in
        both website and web service project, the compilation debug is set to true.
        After clicking "Start Debugging" button. Please do actions as below:
        1. Click top menu item "Debug". In its expanding menu, select "Attach to
        Process". (or press shortcut key ALT+SHIFT+P)
        2. The "Attach to Process" dialog is shown up and there will be two
        processes named "WebDev.WebServ er.EXE".
        3. Select one that you can attach to. Since the other is already attached,
        you will see it gray out and cannot attach to it.
        4. Click Attach button.
        You can view the attached processes by opening from menu:
        Debug->Windows->Processes, when VS.net is in a debug mode.
        For how to attach debugger to a process, please visit:
        http://msdn.microsoft.com/en-us/library/3s68z0b3.aspx.

        After that, you should be able to debug web service code.

        Please try the solution above and let me know if it works for you. I am
        looking forward to your reply. Have a great day!

        Regards,
        Hongye Sun (hongyes@online .microsoft.com, remove 'online.')
        Microsoft Online Community Support

        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.

        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        http://msdn.microsoft.com/en-us/subs...#notifications.

        Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
        where an initial response from the community or a Microsoft Support
        Engineer within 1 business day is acceptable. Please note that each follow
        up response may take approximately 2 business days as the support
        professional working with you may need further investigation to reach the
        most efficient resolution. The offering is not appropriate for situations
        that require urgent, real-time or phone-based interactions or complex
        project analysis and dump analysis issues. Issues of this nature are best
        handled working with a dedicated Microsoft Support Engineer by contacting
        Microsoft Customer Support Services (CSS) at
        http://support.microsoft.com/select/...tance&ln=en-us.
        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.



        =============== =============== =============== ============
        From: "Oriane" <oriane@noemail .noemail>
        Subject: Breakpoint on a web service
        Date: Thu, 4 Sep 2008 18:21:52 +0200
        Newsgroups:
        microsoft.publi c.dotnet.framew ork.aspnet,micr osoft.public.vs tudio.general

        Hi,

        I have a .Net Visual Studio solution with one asp.net Web application,
        which
        uses a Asp.Net Web service. Both are compiled in debug mode, and both are
        using the Studio development web server for debugging. I have also add the
        Web reference to the web service with the "Add Web service in the solution"
        choice, that is the Web app starts the Web service with the Studio
        development web server.

        So I thought I could set breakpoints on the web service C# code. But as
        soon
        as I start the main web app, the breakpoints are turning yellow with a
        exclamation mark and they don't stop anything.

        Did I miss something ?

        Best regards



        Comment

        • Oriane

          #5
          Re: Breakpoint on a web service

          Hi Hongye,
          ""Hongye Sun [MSFT]"" <hongyes@online .microsoft.coma écrit dans le message
          de news:3XruVzzDJH A.3584@TK2MSFTN GHUB02.phx.gbl. ..
          Hello Oriane,
          >
          Thanks for your post. My name is Hongye Sun [MSFT]. It is my pleasure to
          work on this issue for you.
          >
          [...]After that, you should be able to debug web service code.
          >
          Please try the solution above and let me know if it works for you. I am
          looking forward to your reply. Have a great day!
          I didn't have the time up to now, but I will try next week.

          Thank you very much.

          Comment

          • Hongye Sun [MSFT]

            #6
            Re: Breakpoint on a web service

            Hi Oriane,

            It is always our pleasure to help you. If you have any problem when
            implementing the solution, please feel free to let me know. I will try my
            best to reply you at the first time.

            Have a nice day!

            Regards,
            Hongye Sun (hongyes@online .microsoft.com, remove 'online.')
            Microsoft Online Community Support

            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            This posting is provided "AS IS" with no warranties, and confers no rights.


            Comment

            Working...