Sunday, September 14, 2008

Remote Debug .Net

To debug an XML Web service After Deployment, you need to take the help of DbgClr and execute below steps.
• Open the XML Web service in Internet Explorer by entering the URL for the .asmx file, such as http://localhost/MathService/MathService.asmx.
• From the Debug menu in Visual Studio .NET, choose Processes to open the Processes dialog box.
• Select aspnet_wp.exe from the Process list and click the Attach button, which opens the Attach To Process dialog box
• In the Attach To Process dialog box, select Common Language Runtime as the program type to debug and select the program that you want to debug, in this case MathService. Click OK, and then click the Close button to close the Processes dialog box.
• From the File menu in Visual Studio .NET, point to Open, and click File. In the Open File dialog box, select the code-behind file, such as the MathService.asmx.vb or MathService.asmx.cs file, located in the Inetpub\Wwwroot\MathService folder.
• Set breakpoint(s) in the code. In the MathService example, set a breakpoint on the line containing the divide method.
• In Internet Explorer, click the Divide link to display a new page where you can pass parameters to the divide method. Pass the values for the n1 and n2 parameters, and click the Invoke button.
• The debugger breaks the execution at the breakpoint set on the line containing the divide method.
• Use debug windows such as Autos, Locals, and Watch to examine the variables and their values.
• To stop debugging, choose Stop Debugging from the Debug menu.
Remote Debugging
To facilitate some of the remote debugging features required is - To install the Remote Debugging Components, insert the Visual Studio .NET setup disk into the target computer and select the Remote Components Setup link at the bottom of the opening screen.
Once installed, make sure that you have sufficient permissions to Attach to and Debug the target process on the remote machine. In order to simplify this process, Setup creates a local group on the target machine called Debugger Users. Users added to the Debugger Users group will have sufficient permissions to conduct a remote interactive debugging session. However, they also need permissions to attach to the
process itself.

One of the unique requirements for debugging Web services is strong support for remote debugging. The key features that Visual Studio .NET provides for supporting remote debugging include these:
• Visual Studio .NET automatically attaches to the remote ASP.NET process hosting the Web service.
• It allows you to configure the target server to allow remote debugging.
• It can display a logical call stack that spans multiple threads.
• It ensures that you get a complete call stack when an unhandled exception occurs within your application.

No comments:

About Me

Bangalore, Karnataka, India