Debugging VS2005 Web project that uses Interop and unmanaged DLL''s compiled in VB6 hangs, the

Debugging ASP.NET pages works fine for me until I try using Interop to reference some of our VB6 DLL's.

The debugger hangs while I'm stepping through code and eventually exits whenever I debug sections of code that reference these unmanaged DLL's.

For example, in this UpdateTariffInfo sub, the top half of the if block runs fine, but if I try debugging the bottom half of the block, I run in to the issue described above.

ProtectedSub UpdateTariffInfo()

If cboTariff.SelectedItem.Text.Trim =""Then

lblTariffError.Text ="No Tariff Selected."

lblTariffDesc.Text =""

txtDiscount.Text =""

cboTariff.Focus()

ExitSub

Else

lblTariffError.Text =""

tbItems.Rows.Clear()

oTariff = CreateObject("RVadoDatabase.CTariffheader")

oTariff.RetrieveByCode(cboTariff.SelectedItem.Text)

oLoc = Server.CreateObject("RVadoDatabase.CLocation")

oLoc.Retrieve(Session("FKLOC"))

End If

End Sub

If the unmanaged code is free of errors, it runs fine. It almost seems like the Interop "times out" because the debugger is slowing things down.

Can anybody help me with my configuration so I can debug ASP.NET web projects using Interop?

Thank you,

Tobin

[2648 byte] By [tdubyou] at [2008-1-7]
# 1

Hi Tdubyou,

Based on my understand, your asp.net application refers to a unmanaged dll. When you debug the code refers to this unmanaged dll, the debugger has a poor performance. But when you debug the code which doesn't refer to this dll, the debugger works fine. If I have misunderstood you, please feel free to let me know.

During debugging mixed-mode application session, the evaluation of properties by the debugger is an expensive operation. Because unmanaged call stacks and managed call stacks differ, the debugger cannot always provide the complete call stack for mixed code. You can turn off property evaluation by the following steps:

1. From the Tools menu, choose Options.

2. In the Options dialog box, open the Debugging folder and select the General category.

3. Clear the Enable property evaluation and other implicit function calls check box.

I hope this helps.

ThomasSun–MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 2

Tobin,

If I understand you correctly, something went wrong in the unmanaged code that you are calling from your managed asp page? When you are experiencing this, do you have the interop debugger enabled (i.e. right mouse click on your project and choose properties, then select the debug tab and click the enable unmanaged code debugging option.) Try enabling it and see what happens. Also try disabling Just-My-Code.

Hope that helps

The Visual Studio Debugger Team

JacksonDavis-MSFT at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 3

The problem was that the debugger was timing out becuase the native code exists on a single thread and the managed code was multi-threaded.

I did find a work around by loading up the unmanaged code in VB6 and running it in the background. I late bound all objects called via Interop (using createobject) and was able to step through code in both the .net and vb6 debuggers.

tdubyou at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...

Visual Studio

Site Classified