views:

198

answers:

5

I have a Classic-ASP application running in IIS 7 (integrated mode) that needs to call a .NET library that was properly registered as COM.

Everything seems to work find, but I cannot debug the library even if i put several breakpoints in it. The VS debugger seems to step over without breaking.

This is my ASP code:

Dim sso: Set sso = Server.CreateObject("SecurityPlatform.ClassicASP_SSO")
sso.Initialize()

I can step debug those lines, but it seems impossible to step into Initialize().

Any clue?

A: 

I am not sure why can't you step through but here is one trick:

put a call to System.Diagnostics.Debugger.Break method inside your managed code. Once the execution hits this line a dialog will pop up allowing you to attach VS to it.

mfeingold
A: 

If this is an enterprise services/COM+ compoent you might need to manually attach the debugger to the process where the COM component is running. A COM+ component running "out of process" will not have the debugger attached by default.

Last time I did this the process we had to attach to was the last created dllhost (normally highest process id). You can do this via the debug menu of visual studio.

Lee Hesselden
A: 

If you're trying to step in to Managed .NET code being called via COM+, make sure you're attaching the Debugger to dllhost.exe rather than w3p.exe (or whatever process is running your web app...depending on your version of IIS).

COM+ code is not executed in process with the web server...

Justin Niessner
A: 

I could step into by putting a Break() call. Thanks!

Maxolidean
A: 

If you are stepping those lines then you will already be attached to the process for debugging Script. However to debug the code in the .NET component you need to be attached to the process for debugging "Managed Code". You can't step from script into a managed component because you can't debug Script and Managed Code at the same time.

When you attach to the w3wp process make sure the "Attach To:" box contains "Managed Code". Now your break points will work correctly but you won't be able to step the Script code.

AnthonyWJones