Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS7 VB6 Debugging

I recently upgraded from XP to Win 7. I used to be able to debug from an ASP classic app into VB6. However I now get a:

"The call to Server.CreateObject failed while checking permissions. Access is denied to this object"

This only occurrs when I start the dll in VB6 and access the ASP application. Prior to IIS7 this would allow you to step into the VB6 dll. Any ideas?

like image 200
yuben Avatar asked Oct 14 '22 20:10

yuben


2 Answers

I have recently had the same experience going from WinXP to Win7 in our dev environment and had have exactly the same grief with some of our legacy apps. Here's how I fixed it.

To be clear, our Classic ASP website makes calls off to our in-house VB6 .dlls and it was these .dll files that I wanted to be able to step into and debug.

Enable 32-bit applications

In the Application Pools section, right click on the website's application pool and select 'Advanced Settings'.

  • Change the 'Enable 32-bit Applications' to 'True'.

  • Change the 'Managed Pipeline Mode' to 'Classic'.

ASP Authentication

As @GregWoods has suggested, check the authentication details of the website in IIS, As follows:

  • Anonymous Authentication – DISABLED
  • ASP.Net Impersonation – DISABLED
  • Basic Authentication – ENABLED
  • Forms Authentication – DISABLED
  • Windows Authentication – ENABLED

Run the VB6 application inside the Visual Basic IDE and open a web browser; navigate to the website and when the code enters the external VB6 .dll, the Visual Basic 6 environment should now stop on the breakpoints set in your code. Ta da.

A step more??

I also wanted to be able to debug the actual Classic ASP pages themselves from within VS2010 or VS2012... which is entirely possible too, but there's an extra step to add to this list, simply to instruct IIS to :

In IIS, click on the website that created earlier and in the Features view, click on ‘ASP’.

  • Expand the ‘Debugging Properties’ option group.

  • Change the ‘Enable Client-side Debugging’ to ‘True’.

  • Change the ‘Enable Server-side Debugging’ to ‘True’.

  • Click ‘Apply’ to save. (Top right corner of the Actions pane).

Then, in order to make Visual Studio stop on a breakpoint, you have to Attach to Process:

  • Go to the 'TOOLS' menu, and select 'Attach to Process...'

  • Change the 'Attach to' option to 'Automatic: Native code'

  • Select the 'w3wp.exe' process and click 'Attach'.

Now, when you open the website in your chosen browser and nabigate to your website, IIS and VS2010/VS2012 will work in conjunction and Visual Studio will stop on any break points.

Hope this helps you.

like image 172
Brett Rigby Avatar answered Oct 18 '22 02:10

Brett Rigby


I've just run into the same problem, and after applying the above 'fixes', still had a problem. I found that making sure that the web application has Anonymous authentication turned off (I used Windows authentication instead) finally allowed me to debug vb6 from classic ASP.

From this I cannot whether the registry entry, or the DCOM permissions change (both from q259725), contributed to the fix.

Hope this helps someone!

like image 43
Greg Woods Avatar answered Oct 18 '22 01:10

Greg Woods