In the past, I have been using Team Remote ASP Debugger tool to debug my legacy ASP applications in Windows XP. However, the debugger tool stopped working after I migrated my computer OS to Windows 7. I called their tech support and they told me that that tool no longer works in Windows 7 – I need to buy their Windows 7 version for an upgrade price of $200. Wow! $200 is a little bit pricy for an ASP debugger. The heck with it! I am sure there is an alternative out there. After a few trials and errors over the weekend, I was able to figure out how to debug ASP in VS2010. Here is what you need to do:
1. Make sure that the following Windows features are installed on your computer correctly. To see what already installed on your computer, go to Control Panel >> Programs >>Turn Windows Feathers on or off
>>Under Internet Information Services, enable IIS Management Console, IIS Management Scripts & Tools, and IIS Management Service.
>>Under World Wide Web Services:
>Application Development Features - enable everything
>Common HTTP Features - enable Default Document and Static Content
>Security - enable Basic Authentication, Request Filtering and Windows Authentication
>>Check OK
In IIS, under “Default Web Site”, add a new app that points to the physical location of your files (see the example below for creating a new app named HPUnify . Note that an Application Pool is created with DefaultAppPool.
2. In IIS Manager Features View, double-click Default Document and ensure the Default.asp is in the list. Backup to the Features View and double-click - ASP icon.
• Enable Parent Paths - set to True
• Expand Debugging Properties
i. Enable Client-side Debugging - set to True
ii. Enable Server-side Debugging - set to True
iii. Send Errors to Browser - set to True
3. Go to Explorer, right-click on the top folder, select Properties >> Security. Make sure that you are granted to the full control of the physical folder.
4. Finally to Visual Studio 2010 - run Visual Studio as an administrator! Then, open your website - File >> Open Web Site >> File System and select the root folder then click open. Now in Solution Explorer, right-click on the site root and select Property Pages. Under Build, select "No Build", then under Start Options >> Server, select "Use custom server" and enter the base URL with the port number for the site you created earlier: http://localhost/hp-unify - click OK.
Now Go back to Visual Studio 2010 and select Debug >> Attach to Process. At the bottom of the dialog, select both "Show Processes..." check boxes - then in the "Available Processes" list, scroll to the bottom and select w3wp.exe and then click "Attach". If you get a warning select YES/Continue.
Now set breakpoints in your code.
Finally launch your App from IIS manager by right-click on the app select Manage Application >> Browse. Your app should start and you should be able to step through your code (see my example below)
Hope this information is helpful!
Awesome! Very well explained.
ReplyDelete