Debugging visual basic dll library from asp.net hosted in IIS

0

I have the following problem. I have some project written in Visual Basic (not Visual Basic .NET but simple Visual Basic - sic!). I can compile it and generate a dll. Then inside my web application I add reference to this dll library. When I run my web application hosted in default Visual Studio server, everything is fine and I can debug my Visual Basic project. However, when I host my web application in IIS then I can't. Code does not stop in my breakpoint. My asp.net catch the exception when I try to execute some method from the mentioned library which is something like:

Unable to cast COM object of type 'xxx' to interface type 'yyy'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{4C2875B5-3265-306B-9C74-1BEC98986B1A}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Can someone please help me because I've been struggling for 2 days without success.

asp.net
vb.net
debugging
com
asked on Stack Overflow Nov 18, 2010 by niao • edited Apr 11, 2012 by Joel Coehoorn

1 Answer

0

Are you debugging using "Attach to Process"?

First determine the w3wp.exe process:

For IIS6

  • Start > Run > Cmd
  • Go To Windows > System32
  • Run cscript iisapp.vbs
  • You will get the list of Running Worker ProcessID and the Application Pool Name.

For IIS7

  • Start > Run > Cmd
  • Go To Windows > System32 > Inetsrv
  • Run appcmd list wp

Note the Process ID (PID).

Next in Visual Studio:

  • Debug > Attach to Process...
  • Find the w3wp.exe with the right PID and attach

Your breakpoints should work.

answered on Stack Overflow Nov 18, 2010 by MikeM

User contributions licensed under CC BY-SA 3.0