Archive

Posts Tagged ‘visual studio 2008’

Debug your classic ASP Pages in Visual Studio 2005

April 2nd, 2008

This was originally posted at vanslaars.com in December of 2006. I have not tried this with Visual Studio 2008 (and probably won’t have a reason to anytime soon) but I am pretty confident that it would work with 2008 as well told that it does NOT work.

I don’t do much work with classic ASP pages, but part of my role in my current position involves maintaining legacy ASP websites until they are all converted to ASP.NET 2.0. The thing that really gets to me when working with classic ASP are the generic server errors that tell you practically nothing about what went wrong… this, coupled with the fact that none of the members of the current team were here when these applications were written, makes it very difficult to track down and fix bugs.

Well, there is a solution, yet it seems to be a difficult one to find instructions on. Since the first time I worked my way through this, some additional information has been publshed on various blogs… this is my attempt to help fill the gap for those searching desperately for the steps involved in debugging ASP pages through Visual Studio 2005.

The first thing you need to keep in mind is that this requires IIS (5 or 6) and WILL NOT work through VS 2005’s built-in Cassini web server.

Secondly, before you start working through the steps, you need to run your page without debugging (just browsing to it on localhost will do too) BEFORE trying to debug… this requires you to attach the debugger to a process, therefore, the process needs to be started before you attempt to debug (this one got me a couple of time when I first attempted it).

So, here are the steps:

  1. Make sure your site is set to run through IIS (not Cassini)
  2. Make sure you enable ASP debugging on your server
  3. Open your target ASP file in Visual Studio 2005
  4. Set a breakpoint somewhere in your ASP page
  5. Run your page without debugging from Visual Studio (or browse to the page through localhost)
  6. In the Visual Studio menu, go to Debug -> Attach to Process
  7. Choose the process:
    In IIS 6 (Server 2003) choose w3wp.exe
    In IIS 5.1 (XP Pro) you want to choose dllhost.exe - Unfortunately, it isn’t this simple though… you will need to attach to the process based on the process id to ensure that you have the correct process. In order to do this: follow these steps:

    1. Download the ListDLLs utility from sysinternals.
    2. Assuming you have the ListDLLs executable available on your machine, in a command prompt, go to the directory which contains ListDLLs and run the following command:
      listdlls.exe -d asp.dll
    3. This will return the process id for the instance of dllhost that loaded asp
    4. Use this ID to select the process in the Attach to Process dialog
  8. You may need to refresh your ASP page in the browser to hit your breakpoint.

I hope this helps out the next person having difficulty finding these steps.

Happy Debugging.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tools, Visual Studio , , , ,

aspnet_merge.exe exited with code 1 - WTF?

March 31st, 2008

This was originally posted at vanslaars.com in January of 2007. I haven’t encountered this error message with Visual Studio 2008 yet, but the instructions to update the options DO apply for Visual Studio 2008 as well.

When using a Web Deployment project in Visual Studio 2005, you may encounter an error similar to this: ?aspnet_merge.exe exited with code 1?. This reminds me of the classic ASP “Internal Server Error” message, which basically says ” Something is broken, figure it out and fix it!”.

Well, I have good news, you can get more detail with your error messages by setting a simple option in Visual Studio 2005.

To do this, simply browse to Tools -> Options -> Projects and Solutions -> Build and Run, and in the options to the right of the dialog, switch the “MSBuild project build output verbosity” drop-down value to “Diagnostic“. Now you will see detailed output during the build process, including detailed errors when something goes wrong.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

.NET, Tools, Visual Studio ,