How can I debug a VB6 IIS Application on Windows 7 64-bit

Warren Rox picture Warren Rox · Jan 4, 2012 · Viewed 10.4k times · Source

I have a need to be able to debug a Visual Basic 6 IIS Application on Windows 7 64-bit. Not just for a single problem but for continuing development.

An attempt to debug results in an error "An unspecified error has occurred" from the WebClass runtime.

If I do not debug and simply access the compiled webclass the page loads just fine. Therefore, I don't believe there is anything wrong with the registration / configuration of the application but rather this is somehow related to Windows OS security blocking the VB6 IDE from hooking into IIS and allowing it to debug.

Here are all of the things that I have tried:

  1. Disabled User Account Control (UAC) and rebooted.
  2. Modified DCOM component security for machine debug manager (MDM) and assigned "Everyone" launch and activate permissions.
  3. Manually added DCOM entry for "70F214BA-94E2-4bdf-8F30-32CB4A905E4D" which is the VB6 IDE and assigned "Everyone" launch and activate permissions.
  4. Disabled Windows Firewall
  5. Ran the application (VB6.exe) in compatibility mode of Windows XP SP3 with run as administrator option.
  6. Created a new IIS application pool with an identity set to an administrator account. Set the application pipeline mode to classic and enabled 32-bit legacy application support.

This exhausted my extensive experience of things to try. If I create a VB6 Windows Application or ActiveX control I can easily launch and debug.

I've experienced a very similar problem on Windows Server 2003 although a fresh install of W2K3 resolved the problem.

In the Windows System event viewer log there are 2 duplicate entries for Event ID 10004 as follows:

DCOM got error "1326" and was unable to logon DOMAIN\User in order to run the server: {70F214BA-94E2-4BDF-8F30-32CB4A905E4D}

Where DOMAIN\User is my domain account and the GUID mentioned above is the DCOM entry I added for VB ASP Debugging.

The only extra information I have to offer is that Windows 7 64-bit is running in a VM although I am remoted to the console while attempting to debug. I've experienced problems debugging on VMs without a console connection.

If anyone can offer any further suggestions of things to try I would greatly appreciate it.

If anyone can figure this out and succesfully debug an IIS web application on a Windows 7 OS depicting the necessary settings I will offer the current bounty of 300 points!

Answer

yuben picture yuben · Jan 4, 2013

I recently experienced the same problem on my Windows 7 64 bit machine. The solution that worked for me was to check the windows event log (system) for the specific DCOM error. This is the error that I had:

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {17C2D338-9569-4022-8AF2-52A3A124F22D} and APPID {17C2D338-9569-4022-8AF2-52A3A124F22D} to the user NT AUTHORITY\IUSR SID (S-1-5-17) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

The key point for me was to give the IUSR built-in account Launch and Activation permission. After attemtpting to give this user permission to the individual DCOM components and failing, I decided to add the user to the default DCOM permissions for the machine. You can do this as follows:

Run dcomcnfg. Right click on the Console Root/Component Services/Computers/My Computer node. Select Properties. Select the 'COM Security' tab. Click the 'Edit Default' under the 'Access Permissions' group. Click 'Add'. Enter the User indicated in your event log (mine was IUSR). Click OK. Repeat for the 'Launch and Activation Permissions' group. Select OK on all the dialogs.

I did not have to reboot my machine for these setting to take effect. I used the same method to debug the VB6 dll that I used on XP i.e. run the dll under VB6 (unattended execution), set a break point, navigate to a page that accessed the dll, and wait for the breakpoint to be hit. Hope this helps.