dcsimg
Results 1 to 3 of 3

Thread: VB newbie help debugging .cls, .asp files in IIS environment

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    3

    VB newbie help debugging .cls, .asp files in IIS environment

    Hi Everyone, I'm an experienced coder, but have little VB experience and inherited an old hybrid app. It's VB6 code mixed with C/C++ and involves an ODBC driver. In any case, It's instantiated as a web service (IIS) that starts an ASP script. I know it's failing in a particular .cls file, but I can't find a way to set a break point to catch it.

    I've used VS 2015 and VS 2010 to try attaching to w3wp.exe (I'm on Windows Server 2012) and dllhost.exe, but no luck. I can trap code in the ODBC driver part of things, and when the exception is hit, if I then attach to w3wp.exe, it shows the .ASP code (though I can't set a break there), but I can't get to the .cls file that's being called.

    The error message I get from the browser is just "An error occurred on the server when processing the URL.", which is useless. I'm able to attach to w3wp.exe and set breakpoints after the app has started but before the exception happens, but can't seem to catch breaks in the .cls code.

    Can anyone help? I can use VS 2008, 2010, 2012 2013 or 2015 if any one is better for this purpose. Thanks.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,697

    Re: VB newbie help debugging .cls, .asp files in IIS environment

    Welcome to the forums
    Since you have the source code, recommend the following

    1. Locate the error string in the cls file
    2. Temporarily replace the line of code raising the error or setting the message

    In other words, find the line(s) of code that is currently setting the error string or raising it and replace it with something more meaningful

    if a string is being set, you probably have a portion of the code setting a string value to "An error occurred on the server when processing the URL." and located in an error trap (If Err Then ... or On Error GoTo [some label]). Replace that string assignment with Err.Description

    if err is being raised, then you likely have a line of code something like Err.Raise .... where a description is being hardcoded or preset in a variable. Replace that with Err.Raise Err.Description ....

    By finding that error string in the class, at least you should be able to narrow down which class method is affected.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    3

    Re: VB newbie help debugging .cls, .asp files in IIS environment

    Hi LaVolpe,

    Thanks for the reply, but I'm afraid the error message I get is a general message from IIS or the browser, not something specific to my application. The crux of the matter is: how do I set a break point in the .cls file? I suppose if I knew a way to output messages from the .cls file either to the web page (which might be erased before they can be read) or to a log file, that might help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width