If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

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.

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.

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.