PC Review


Reply
Thread Tools Rate Thread

Breakpoint on a web service

 
 
Oriane
Guest
Posts: n/a
 
      4th Sep 2008
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

 
Reply With Quote
 
 
 
 
Jeff Dillon
Guest
Posts: n/a
 
      4th Sep 2008
"Oriane" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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?


 
Reply With Quote
 
Oriane
Guest
Posts: n/a
 
      5th Sep 2008
Hi Jeff,
"Jeff Dillon" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> "Oriane" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
> Are they both part of the same solution?


Yes

 
Reply With Quote
 
Hongye Sun [MSFT]
Guest
Posts: n/a
 
      5th Sep 2008
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.WebServer.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 ((E-Mail Removed), 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:
(E-Mail Removed).

==================================================
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" <(E-Mail Removed)>
Subject: Breakpoint on a web service
Date: Thu, 4 Sep 2008 18:21:52 +0200
Newsgroups:
microsoft.public.dotnet.framework.aspnet,microsoft.public.vstudio.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



 
Reply With Quote
 
Oriane
Guest
Posts: n/a
 
      5th Sep 2008
Hi Hongye,
""Hongye Sun [MSFT]"" <(E-Mail Removed)> a écrit dans le message
de news:(E-Mail Removed)...
> 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.

 
Reply With Quote
 
Hongye Sun [MSFT]
Guest
Posts: n/a
 
      8th Sep 2008
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 ((E-Mail Removed), 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:
(E-Mail Removed).

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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Really weird - Code acting as though breakpoint set, no breakpoint BlueWolverine Microsoft Access VBA Modules 6 13th Mar 2008 04:20 PM
Problem with the breakpoint hitting(at runtime breakpoint was disa Ranjit Microsoft Dot NET Compact Framework 0 23rd Feb 2008 06:56 AM
Debugging windows service: interrogation mark in breakpoint Diego F. Microsoft VB .NET 1 18th Oct 2007 05:57 PM
Breakpoint ok, no breakpoint messes up... Vikxcel Microsoft Excel Programming 0 4th Jan 2006 09:18 PM
project stops at imaginary breakpoint, but no breakpoint exists Mark Microsoft ASP .NET 4 26th Apr 2004 05:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:11 PM.