Because of the mod_aspdotnet sub-project implementation problem (or bug) in the Apache2 project, there are some differences in the correctness of running the ASP.net program on it, and in the Aspnet_wp|w3wp on IIS. So it is necessary to debug the source code of the ASP.net project on Apache (mod_aspdotnet). Although the ASP.net 2.0 has been officially released, the 1.1 version of the project is currently in the mainstream, so let's look at Apache support for these two versions of the framework. As I said earlier, the ASP.net 1.1 project relies heavily on IIS, so at the moment I can only debug an existing ASP.net 1.1 project on Apache and not create it (after that). Because IIS first installs and consumes 80 ports, my Apache WEB server can only run on other ports (for example, 8080, via httpd.conf file configuration).
First, we need to have the debugged project run correctly on IIS, and the project can be opened correctly by the Vs.net 2003 IDE. Then configure Apache so that the project runs correctly on Apache as well. We can go through the IDE's ctrl+alt+p to attach the process that we want to be debug, when we see that there are two Apache.exe processes in the task list (which requires check "show system Processes"). I don't know what it should be, though they are all ". NET, Win32," but only one is the mod_aspdotnet hosting process. Of course, we can still use a small trick to judge, is to open taskmgr and refresh Apache running Web Site page, see that Apache.exe process CPU, then it is asp.net support module host. Attach successful after you can set breakpoints in the Vs.net, the step into/out the source code level debugging.
Above is the ASP.net 1.1 project debugging method, if is ASP.net 2.0 project? As the. NET Framework and Visual Studio 2005 improved, debugging 2.0 of the ASP.net project became odd easy! Once you've run the project on Apache, you can use Visual Studio 2005 to open the source code (*.cs) file of the page you want to debug, and then set the breakpoint directly after you attach the Apache process, and you don't need to open the project. Of course, and IIS completely disconnected from the relationship.
Figure 1
Whether it's 1.1 or 2.0, you need to determine which Apache.exe process is the host
A known possible problem with debugging failures on Apache:
1, not using the debug version of the project DLL to run, this ... Still a problem?
2, the second case, if not attention, may be considered Apache can not debug 1.1 of the asp.net. If the machine is installed at the same time Fx1.1 and fx2.0,mod_aspdotnet will default to our ASP.net program loaded on the Fx2.0 run, then if you use Vs.net 2003 to debug will not be able to attach any Apache.exe process. Of course, it is possible to use Visual Studio 2005. The workaround requires that the "aspnetversion v1.1.4322" command be used in httpd.conf to display the. NET framework version of the specified ASP.net program at run time.