How to debug component technology for ASP server

Source: Internet
Author: User

How to debug component technology for ASP server

This article mainly describes how to debug ASP server-side component technology, including this complex error message:

One, ASP 0115 Error.

Second, the code in a separate EXE file to run well, but once put into the ASP to generate the call failure information

Background of this article:

In the first case: can you see this information in your browser?

Error \ ' ASP 0115\ '

Unexpected error

file://.asp

A trappable error occurred in A external object. The script

Cannot continue running.

This is the ASP 0115 error that makes every programmer have a headache, and this error can be caused by many reasons. Many may speculate that it may be the result of Microsoft's own bugs and complain that Microsoft has not responded to the patch.

In practice there are some that are true, but in most cases this is not the case.

And a lot of it is caused by the wrong access to the Inetinfo.exe process in your own code.

The second situation: Have you ever encountered this embarrassing situation, write your own code if it is in an EXE project to run well, but once you call it from an ASP page, you will fail?

Similarly, there are many reasons for this phenomenon, and most of them are because the ASP is running under a specific system account, in such a context, the permissions it runs is a problem that can not be ignored.

I think that many people who have been doing this for so long have a lot of experience in debugging a single EXE program, but when you're writing a program that runs in an IIS environment, you'll face more challenges than traditional debugging.

Although you can use VB or VC + + to write the ASP components, but the VC + + debugger will be your best debugging tools.

Get your components ready.

In order to debug the components you write, you have to have the information needed for debugging. Symbols allows you to display errors in the first few lines of your code when your component fails.

So how do we generate the symbols of the components needed in VB?

If your component is written using VB, you can create debugging information for your component by selecting the ProjectProperties command in the Compile menu.

Make sure you compile the code into ' Native codes ' and use ' No optimization '.

Then we in VC + + How to generate components need to symbols it?

If your component is written using VC + +, the easiest way is to choose a debug configuration to generate debugging information. From the Build menu, click ' Set Active Project Configuration '. You'll find the ' Win32 Debug ' option.

Or, you can manually define the debug error information that the component needs to contain, select Settings from the Project menu, and then go to the link page. Make sure generate Debug info is selected.

Start the debugging process

As mentioned earlier, we will use VC + + to complete the debugging work. Well, run it, of course there is no need to build a project or a workshop.

Select the attach to Process in start Debug in the Build menu. In the Attach to Process dialog box, select Show System processes. Locate the process Inetinfo from the list box, and then click OK.

Next, you want to make sure that the symbols has been reprinted into memory. From the Project menu, click Settings to select the Debug page and select additional from the Category Drop-down box DLLs '

If you don't see the component you've written in the list, click the first line blank, and then enter the filename, or select the ' ... ' button to find the file name, click OK.

Well, now that you've loaded your symbols, you need to load some source code.

Select Open from the File menu. Locate the source file you want to debug. If your component is written using VB, make sure that you select all the file types in the Files of type Drop-down box, and then locate the file you want, and then click Open.

OK, now you can put breakpoints in your code, set observations, look at the call stack, and so on like you're 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.