Using Error Detection to profile a DLL called by a web application written in .NET

0 Likes

This article provides steps for profiling a native DLL being called by a .NET web application.

Problem:

I am unable to profile a DLL with Error Detection. The DLL is being called by their .NET web application. What should I do?

Resolution:

First locate the executable WebDev.WebServer.exe. It is normally located under this directory: C:\WINXP\Microsoft.NET\Framework\v2.0.50727 (VS2005 present, but not VS2008) C:\Program Files\Common Files\microsoft shared\DevServer\9.0 (VS2008 present). When you find it under its directory, type WebDev.WebServer.exe ? from the command line. You will see that that executable has a few parameters that can be passed to it. Although the /vpath and /port parameters are optional, you can use all 3. An example look like this:

WebDev.WebServer.exe /port:1881 /path:"C:\Documents and Settings\...\WebApplication3" /vpath:"/Default.aspx"

So for port, it can be anything that is unused, the /vpath is the path you can designate in your application's properties page of the IDE. For example, if your /vpath is /myapp then your URL will be http://localhost:yourport/myapp for your web application.

Once you run the WebDev.WebServer.exe executable, you will see in your system tray an icon for ASP.NET Development Server. Right click and select Show Details, you will then see the URL for your web application. Clicking on that will launch your web application in a browser.

When you have the first two steps working properly, go ahead and stop the ASP.NET Dev Server by right clicking the icon and selecting Stop.

The reason we are monitoring WebDev.WebServer.exe for your example is because it is a proper executable that Error Detection can hook into. As you may have noticed from the IDE, Error Detection cannot profile a .NET solution or a DLL solution directly. This is the reason we have the Error Detection standalone tool available. This tool can be accessed from the Start Menu > Programs > Compuware DevPartner Studio > Error Detection. By hooking into the server that hosts your .NET web application, Error Detection is able to monitor all calls to and from it as well as between your web application and NATIVE DLLs.

Go into the standalone Error Detection application and select the File Menu > Open. Navigate to WebDev.WebServer.exe and open it.

Select the Program Menu > Settings. You will see a field labeled Command Line Arguments. Enter the parameters for WebDev.WebServer.exe in those lines. Using the example I have provided above:

/port:1881 /path:"C:\Documents and Settings\...\WebApplication3" /vpath:"/Default.aspx"

Next, click OK.

From the standalone BC, go to the Program Menu > Start. This will open up the same ASP.NET Dev Server Icon in your system tray. Right click the icon and launch your application by selecting the "Open in Web Browser" or via "Show Details" and clicking the hyperlink URL. You can also just open up a browser and type your application's URL. You don't have to do it from the icon.

Once you have your application running, any calls to native DLLs will be detected by Error Detection. Note: You will only see the profiling information for the DLLs after you shut down your web server. To shut down the server and to stop the Error Detection profiling, just right click the icon in the system tray and select Stop. Your session profile should be available shortly.

Old KB# 14761
Comment List
Anonymous
Related Discussions
Recommended