How to debug a Classic ASP app in VS 2012

16,252

That looks like server side asp building a client side javascript function? if thats the case attatching your debugger to explorer.exe is useless (unless you want to debug the resulting JavaScript function - in which case F12 IE dev tools would be easier), you need to attach the debugger to Inetinfo.exe (the iis process running your server side asp) or Mtx.exe / w3wp.exe (depending on your configuration & iis version).

For more information please see the following msdn article:

http://msdn.microsoft.com/en-us/library/ms241740.aspx

And a similar article on VS2008 (should be a similar principle to 2012):

http://www.codeproject.com/Articles/28792/Debugging-Classic-ASP-VBScript-in-Visual-Studio-20

Share:
16,252
birdus
Author by

birdus

Updated on July 26, 2022

Comments

  • birdus
    birdus almost 2 years

    Possible Duplicate:
    How do you debug classic ASP?

    • I've added a New Website in VS2012 and pointed it at a virtual directory I created in IIS.
    • In IIS, I enabled server side debugging
    • The port for this website in IIS is 5555
    • In VS for the project properties, I have the start URL as localhost:5555, which runs my site
    • No debuggers are enabled in the project properties (there isn't one for Classic ASP)
    • I set a breakpoint in a file which is included at the bottom of default.asp
    • I run with site without debugging (Ctrl-F5)
    • Then I attach to the process (IE10)
    • Then I refresh the home page (default.asp)
    • The breakpoint is not hit
    • How can I get the debugger to stop at my breakpoint so I can debug this page?

    This is pre-existing code. I'm just trying to get it working. No code critique is necessary, unless it's a bug that fixes the problem!

    I set the breakpoint near the top of the first code block in this javascript method, but it's never hit.

    function declareLogos() {
        <%   ' get logos
    
        SQL = "SELECT l.LogoFileName, p.SortOrder FROM InrixCustomerLogo l join InrixCustomerLogoPage p on l.LogoCode = p.LogoCode WHERE p.PageFileName = '" & fn & "' AND SortOrder > 0 ORDER BY SortOrder"
        On Error Resume Next
        Set oLOGO = oConn.Execute(SQL)
        logoerror = Err.Number
        On Error Goto 0
        x = 1  ' array counter
    
        %>
    
        <% If NOT logoerror Then %>
        <% Do While NOT oLOGO.EOF %>
        i[<% =x %>] = '<% =oLOGO("LogoFileName") %>';
        <% oLOGO.MoveNext : x = x + 1 : Loop %>
        <% End If %>
    
        imax = <% =x-1 %>;
        ilast = <% =(((x-1)*4)/4) %>;  // <% =(((x-1)*4)/4) %>   this is imax - 1 that is divisible by four
    }
    
  • Ehsan
    Ehsan over 6 years
    The first link is not available any more and here is the message "This topic is no longer available"