views:

2601

answers:

3

I've been assigned a web app written in VB using VStudio.net 2003. I am trying to configure the source on my localhost (VStudio 2008) so I can explore and learn about the current app (before I begin any real changes) and I cannot get debugging working for the web service project(s).

Symptom 1: "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. See help for more information".

This happens when I try to F11 (stepInto) the proxy class which invokes my actual web method.

Symptom 2: Pre-setting a breakpoint in my .asmx file code on the statement that will be invoked does not work (i.e. the debugger simply doesn't stop).

Having described the situation, here's how my VStudio Solution is configured:

Service1 - project created from the VB - WEB - ASP.NET Web Service Application template; this Service1 project contains my main .asmx source code I want to debug. Web.config for this project contains compilation defaultLanguage="vb" debug="true"

ProxyService1 - a separate project created from the Windows - [VB]Class Library template; here the form1.vb file was deleted; I visited "Add Service Reference" -> Discover (Services in solution) and then in the "Compatibility" section I click "Add Web Reference". Then choosing the above Service1, I assign it a "web reference name" of WSservice1. This results in a Reference.VB file and when I build the ProxyService1 class a .DLL of the same name in the projects bin\Debug folder; this project has an App.Config file with compilation defaultLanguage="vb" debug="true"

Project1 - the main UI project with the .aspx and .vb files that call the webservice; project1 has a reference to ProxyService1.DLL; Web.config for this project contains compilation defaultLanguage="vb" debug="true". I arrive at a breakpoint in one of the files in this project called message.vb which looks roughly like this:

Public Class Message
Dim wsZipeee As New ProxyService1.WSservice1.myService
Dim dsMessage As DataSet
Public Function GetMessageByType(ByVal iMsgType As Integer) As DataSet
    dsMessage = wsZipeee.GetMessageByType(iMsgType)

If I rightmouse/go to definition on the stmt above, here is the code in Reference.vb in my ProxyService1 project:

    <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ZipeeeWebService/Zipeee/Get Message By Type", RequestElementName:="Get Message By Type", RequestNamespace:="http://tempuri.org/ZipeeeWebService/Zipeee", ResponseElementName:="Get Message By TypeResponse", ResponseNamespace:="http://tempuri.org/ZipeeeWebService/Zipeee", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
    Public Function GetMessageByType(ByVal iMsgType As Integer) As <System.Xml.Serialization.XmlElementAttribute("Get Message By TypeResult")> System.Data.DataSet
        Dim results() As Object = Me.Invoke("GetMessageByType", New Object() {iMsgType})
        Return CType(results(0),System.Data.DataSet)
    End Function

For completeness, here is the corresponding webmethod in the .asmx file of the Service1 project:

<WebMethod(MessageName:="Get Message By Type")> _
 Public Function GetMessageByType(ByVal iMsgType As Integer) As DataSet
    con = New SqlConnection(sConnZipeee)
    con.Open()

Everyplace in IIS I know to check and within the project properties I have checked for the proper Debug setting to be checked or set on. I've debugged other things that are set up like this but I am truly stuck on what I've missed on this "solution".

Thanks very much in advance for any help.

A: 

When I debug webservices, I usually set them up to "Wait for a request from an external application" in my properties. I also usually run the project in 2 instances of VS, one for webservice and one for client. I can put break points in the webservice and everything hits and I can see what is happening.

CSharpAtl
OK, I noticed the radio button (never saw this before) in the Properties of the web service and selected it. Not exactly sure how you do your approach: (1) start up VS with my 3 projects in it then F5 stopping at breakpoint in the UI project before call to webservice (2) start up VS with same 3 projects and breakpoint in .asmx code (this approach fails to stop in same way as above). Alternatively, I have one instance of VS and I right mouse on the UI project then Debug->Start new instance for each project needing debugging. If that is what you meant, that does not work for me either.
John Galt
I run 2 instances of VS...each running debug but one started with the webservice project and one with the client project.
CSharpAtl
You can just have your VS instance debug the webservice, like I described, and just have the client code connect to it....does not matter if that is in debug, unless you are debugging the client too.
CSharpAtl
A: 

try to attach debugger on running aspnet_wp.exe process

Tolgahan Albayrak
Not sure what you mean. I click 'Debug' then 'Attach to Process'. I get a complex looking dialog box where I don't know what choices to make. From Available Processes, do I choose:aspnet_wp.exedevenv.exevsjitdebugger.exeAfter choosing one of these (or something else??) then how to proceed to breakpoint?
John Galt
open your web service project on visual studio, then click debug->attach to process, on the dialog box shown, select aspnet_wp.exe then click attach button. when you do request to web service, if you have break points they will be executed
Tolgahan Albayrak
Sorry, still unclear (not matching with what I see here..).I have 3 projects; not clear how to start. Unless, I start my .aspx web app there is no process called aspnet_wp.exe. Yet when I do start it and then go to Debug / 'Attach to Process', the entry is greyed-out (disabled) and so is the 'Attach' button. Yet, I cannot get the debugger to stop at the breakpointed stmt in my .asmx file in my webservice project.
John Galt
A: 

I normally put of the logic to debug in class library that I can start with a console application for debug. This link will be useful too if you must debug as a service.

kenny
Note: The link above is for a debugging Windows Service not a Web Service.
DeveloperDan