Showing posts with label Classic ASP. Show all posts
Showing posts with label Classic ASP. Show all posts

Saturday, February 14, 2009

Debug Classic ASP in Visual Studio 2008

It is a little bit tricky to debug classic ASP in Visual Studio 2008 so I decided to document it. There are many articles that describes it, but this is how I managed to get it to work.
Visual Studio 2008 Service Pack 1 must be installed, it adds debugging and IntelliSense functionality for classic ASP.
Then the IIS must be configured to allow debugging, on both client- and server-side. Remember also to set Send Errors To Browsers to True if the ASP is hosted in IIS7.
image

Now open Your ASP project in Visual Studio and set the local IIS as Web server:

image

Ok, then its time to debug. Open Your ASP-page in Windows Explorer. Then attach the VS2008 debugger to the IIS hosting process, i.e. select Debug->Attach to Process... and attach to the dllhost.exe if running on IIS6 or w3wp.exe if running on IIS7.
If there are multiple processes, pick the one with Script type.

The Attach to: should be set to Script code.

(The Show processes from all users must be checked to see the hosting processes)

image

Add some breakpoints, hit the F5 to reload the web-page and now should the debugger stop at your breakpoints.

Important: Visual Studio often crashes when ending a debug-session. If that happens, kill the dllhost.exe/w3wp.exe to avoid unpredictable errors.

Thursday, February 5, 2009

Consuming WCF Service From Classic ASP

Consuming WCF services from classic ASP is described on several places, for instance http://msdn.microsoft.com/en-us/library/bb735856.aspx#_Toc156817372.

I ran into the "The maximum string content length quota (8192) has been exceeded"-exception, i.e. the message I try to send is larger than 8192 bytes.

Ok, just to add a binding configuration to allow larger messages. But I consume the WCF service from VB Script with a moniker, so where to define the binding configuration?

It took a while before I realised that, as classic ASP does not have a web.config, the binding configuration has to be in the machine.config.

Not so dynamic but an acceptable solution.