How to debug ASP Server Components

Source: Internet
Author: User

This article describes how to debug the ASP server component technology, including the complex error information:
I. ASP 0115 Error.
2. The code runs well in a separate EXE file, but once it is put into ASP, the call fails.

Background:
First case: Have you ever seen this information in your browser?
Error \ 'asp 0115 \'
Unexpected error
/ /. Asp
A trappable error occurred in an external object. The script
Cannot continue running.
This is the ASP 0115 error that makes every programmer suffer. This error can be caused by many reasons. Many may speculate that it may be caused by Microsoft's own bug and complain that Microsoft has not provided a response patch.
In fact, this is true in practice, but in most cases it is not. In most cases, it is caused by incorrect inetinfo.exe processes in the code you wrote.
Case 2: Have you ever encountered this embarrassing situation? If your own code runs well in an exe project, but once you call it from an ASP page, will it fail?
Similarly, there are many reasons for this phenomenon, most of which are because ASP runs under a specific system account. In this context, its running permissions cannot be ignored.
I think many programmers who have been working for so long have rich experience in debugging an EXE program separately. However, when you compile a program running in the IIS environment, you will face more challenges than traditional debugging.
Although you can use VB or VC ++ to compile ASP components, the VC ++ debugger will be your best debugging tool.

Prepare your Components
To debug the components you have compiled, you must have information required for debugging. Symbols allows you to display the lines in your code with errors when your component fails.
So how do we generate the symbols required by the component in VB?
If your component is written in VB, you can create debugging information for your component by selecting the ProjectProperties command in the Compile menu.
Make sure that you compile the Code into 'native Code' and use 'no optimization '.
Then how do we generate the symbols required by the component in VC ++?
If your component is written in VC ++, the easiest way is to select debugging configuration to generate debugging information. Click 'set Active Project configuration' from the Build menu. You will find the 'win32 debug' option.
Alternatively, you can manually define the debugging error information required by the component. Select Settings in the Project menu and go to the Link page to ensure that Generate debug info is selected.
Start the debugging process
As mentioned above, we will use VC ++ for debugging. Well, run it. Of course there is no need to create a project or work room.

Select Attach to Process in Start Debug In the Build menu. In the Attach to Process dialog box, select Show System Processes. Find the Process inetinfo from the list box, and click OK.
Next, make sure that the symbols has been reprinted into the memory. From the Project menu, click Settings to select the Debug page, and select Additional DLLs from the Category drop-down box'
If you do not see the component you have written in the list, click the empty line in the first line, enter the file name, or select the '...' button to find the file name and click OK.
Now that you have loaded your symbols, You need to load some source code.
Select Open. From the File menu to find the source File you want to debug. If your component is written in VB, make sure to select all file types in the Files of Type drop-down box, find the file you need, and click Open.
Now you can place breakpoints in your code, set observation values, view call stacks, and so on, just like debugging a traditional exe.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.