Visual Studio Web Applications—ASP.NET Development Helper

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Articles
Visual Studio Articles

Visual Studio Web Apps

© 2006 M. MacDonald, M. Szpuszta

ASP.NET Development Helper

Another interesting tool that’s only begun its development is the ASP.NET Development Helper, a free tool created by Nikhil Kothari from the ASP.NET team. The central goal of the ASP.NET Development Helper is to improve the debugging experience for ASP.NET developers by enhancing the ability of the browser to participate in the debugging process. Currently, the ASP.NET Development Helper is limited to just a few useful features:

  • It can report whether a page is in debug or tracing mode.
  • It can display the view state information for a page.
  • It can display the trace information for a page (and hide it from the page, making sure your layout isn’t cluttered).
  • It can clear the cache or trigger an application restart.

Many of these features haven’t been covered yet, but you’ll see a brief example of the ASP.NET Development Helper in the next chapter. The design of the ASP.NET Development Helper is quite interesting. Essentially, it’s built out of two pieces:

  • An HTTP module that runs on the web server and makes additional information available to the client browser. (You’ll learn about HTTP modules in Chapter 5.)
  • An unmanaged browser plug-in that communicates with the HTTP module and displays the important information in a side panel in the browser (see Figure 2-34). The browser plug-in is designed exclusively for Internet Explorer, but at least one other developer has already created a Firefox version that works with the same HTTP module.


Image:7680f0234.jpg
Figure 2-34. The ASP.NET Development Helper


To download the ASP.NET Development Helper, surf to http://www.nikhilk.net/Project.WebDevHelper.aspx. There you can download two DLLs, one for the HTTP module (WebDevInfo.dll) and one for the browser plug-in (WebDevInfo.BHO.dll). Copy these to any directory.

Then, install the browser extension with the following command line:

regsvr32 nStuff.WebDevInfo.BHO.dll

Next, you need install the assembly for the HTTP module into the GAC. You can do this by dragging and dropping in Windows Explorer, but it’s generally easier to use the gacutil.exe utility. Start a Visual Studio command prompt (choose Programs > Visual Studio 2005 > Visual Studio Tools > Visual Studio 2005 Command Prompt from the Start menu), and then run this command:

gacutil /i nStuff.WebDevInfo.dll

Now, when you want to use this tool with a web application, you need to modify the web.config file so it loads the HTTP module. The content you need depends on the exact version of the tool you’re using, but it looks something like this:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
    <httpModules>
      <add name="DevInfo" type="nStuff.WebDevInfo.DevInfoModule, nStuff.WebDevInfo,
Version=0.5.0.0, Culture=neutral, PublicKeyToken=8fc0e3af5abcb6c4" />
    </httpModules>
    ...
  </system.web>
</configuration>

Now, run one of the pages from this application. To actually call up the browser plug-in, look for a button (with a gear icon) in the browser, which will have been added to the end of the Standard toolbar. When you click this icon, you’ll see a display like the one shown in Figure 2-34 (assuming you’re currently viewing an ASP.NET page from an application that has the matching HTTP module loaded).


Previous_Page_.gif Next_Page_.gif




Personal tools