Enable Script Debugging in Classic ASP / MVC3 hybrid application
I have a site that is a .Net MVC 3 / Classic ASP hybrid. We have 开发者_如何转开发this as we are steadily replacing the Classic ASP bits with .Net.
Currently when I hit F5 in VS2010 the site spins up and runs fine. However, I don't seem to be able to set break points in the Classic ASP code. How can I do this in IIS Express?
As far as I know ilive, you cannot debug classic the same way as you would, say with vb.net or c# because classic asp is not compiled. Therefore an executable is not created and loaded for you to be able to actually use say intellisense.
WIsh it would though. How about moving to vb.net, its so much better!
You can debug classic ASP the same way as .NET.
You will have to enable server-side debugging in IIS. The location differs depending on what version of IIS you have, but in IIS7 you can doubleclick the ASP icon in IIS manager for your website (or for all websites) and enable client-side and server-side debugging.
As long as you develop on the same machine as IIS is running, errors will be caught and you will get a choice of possible debuggers, including your installed visual studio software.
You can add breakpoints and watches as needed.
There is even a vbscript keyword "stop" you can use in your classic ASP code to get a breakpoint and start the debugger.
I put together this ASP include class which works with Firebug+FirePHP. It allows you to log values (including strings, multi-dimensional arrays and even objects created with json.asp) to the firebug console and view ASP's built in collection objects which can help (particularly with Ajax where you can't output debug data without breaking the json response.) Ajax script load times and errors are automatically logged for quick viewing.
https://github.com/dmeagor/ClassicASP-FirePHP
Just include the file and use log(somevalue) to send formatted variables to the firebug console.
Released under MIT open source license
精彩评论