Failed to debug web service project in Visual Studio 2008

I was assigned a web application written in VB using VStudio.net 2003. I am trying to set up a source on my localhost (VStudio 2008) so that I can examine and learn about the current application (before I start with real change). and I cannot get debug work for the web service projects (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 execute the F11 (stepInto) proxy class that calls my actual web method.

Symptom 2: Presetting a breakpoint in my .asmx file in the statement to be called doesn't work (i.e. the debugger just won't stop).

Having described the situation, this is how my VStudio solution is configured:

Service1 - a 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. The web.config for this project contains the compilation defaultLanguage = "vb" debug = "true"

ProxyService1 - a separate project created from the Windows Class Library template - [VB]; the file form1.vb has been removed here; I visited Add Service Link → Discovery (Services in Solution) and then under Compatibility click Add Web Link. Then, choosing the above Service1, I assign it the "web link name" WSservice1. This results in a Reference.VB file and when I create a ProxyService1 class with a .DLL with the same name in the bin \ Debug projects folder; this project has an App.Config file with compilation defaultLanguage = "vb" debug = "true"

Project1 is the main UI project with .aspx and .vb files calling the web service; Project1 has a link to ProxyService1.DLL; The web.config for this project contains the compilation defaultLanguage = "vb" debug = "true". I am getting a breakpoint in one of the files in this project called message.vb that looks something 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 go back / go to the definition on 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 web method 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()

      

Everyone in IIS that I know to check and within the project properties, I have verified the correct Debug setup or installation. I've debugged other things that are configured this way, but I'm really fixated on what I missed in this "solution".

+1


a source to share


4 answers


When I debug web services, I usually select the Do not open page. Wait for request from external application option in the Web section of my project properties ( more details here ). I also usually run the project in two VS instances, one for the webservice and one for the client. I can put breakpoints on the webservice and everything hits and I can see what happens.



+1


a source


For information - if you have the ability to search for debug .NET4 web service from VS2008 / .NET3.5 application, you need to start the service in VS2010, set a breakpoint on the service, and then start the application from VS2008 as usual. The breakpoint will be removed.



Without starting the service in VS2010, you will receive the error described above.

+1


a source


try attaching a debugger when starting the aspnet_wp.exe process

0


a source


I usually add debugging logic in a class library, which I can start from a console application for debugging. This link will be helpful if you have to debug it as a service.

0


a source







All Articles