1

I have a legacy VB6 application that makes calls to a COM+ component written in C# (targeting .NET Framework v2) for TCP/IP communications.

This mode of operation has worked across various operating systems and has been successfully deployed to Windows XP, Vista and 7 environments.

I've just started testing the software in Windows 8.1 and when the VB6 application tries to make calls to the COM+ component it reports "automation error". These kinds of errors in the past have been due to the COM+ registration failing and are quickly rectified by manually registering the COM+ component using regsvcs.exe.

The software is installed by and MSI which also runs a script which calls regsvcs.exe to register the COM+ component. For Win 8.1 I had to change the path of regsvcs.exe from:

C:\Windows\Microsoft.NET\Framework\v2.0.50727

To:

C:\Windows\Microsoft.NET\Framework\v4.0.30319

I tested this installer on both Win 7 and Win 8.1. On Win 7 the COM+ calls work fine. The problem I'm having with Win 8.1 is that the COM+ component seems to be registered properly, however the calls to the component still fail. Everything looks fine in Component Services and the COM+ application starts when the VB6 call is made, but the automation error is returned and the call fails.

Note: The Win 7 and 8.1 environments I'm testing on are 64 bit.

It seems that something relating to Component Services and COM+ applications has changed between Windows 7 and Windows 8.1, but I can't seem to find a solution.

Has anyone experienced something similar or any pointers on what the problem might be?

Span
  • 332
  • 3
  • 13

2 Answers2

2

After many hours of trying different things, I've found a solution. I had to enable .NET Framework 3.5 (including Framework 2) and change the path to regsvcs.exe back to C:\Windows\Microsoft.NET\Framework\v2.0.50727.

Now after re-installation the calls to the COM+ component are working. Still unsure as to what the difference is between using this utility from the v2 folder and the v4 folder.

As an aside, while trying to enable .NET Framework 3.5 using the 'Turn Windows Features On and Off' feature in Programs and Features, I kept getting the error 0x800F0906.

I ended up having to install it from the mounted Windows 8.1 ISO using the following command:

dism /online /Enable-Feature /FeatureName:NetFX3 /All /Source:E:\Sources\SxS /LimitAccess

Where E:\ is the drive letter of the mounted ISO.

The process I followed was described here: https://yellowduckguy.wordpress.com/2012/10/19/windows-8-fix-enable-feature-net-3-5-error-0x800f0906/

Span
  • 332
  • 3
  • 13
0

I facing exactly the same problem like you, i've made a .NET COM Interop DLL for calling from Vb6 . My software working on all Windows version except one day i found some computer using Windows 8 having trouble when run my software. The error i got is Automation Error.

After a research, i've found that if we use the .NET version v4.0.30319 on Window 8 to register our .NET 2.0-3.5 assembly. It may not work, i don't know why but may be the compatibility of different .NET version or a new bug from Microsoft. (i know that .NET 4.0 can run .NET 2.0 assembly but don't know why there are some exception on Window 8).

So the best solution for me now is :

1) Turn on .NET 3.5 on Window 8 ( this solution is time consuming because you will need to ship the Windows 8.1 ISO within your installer)

2) Build two target version of .NET framework for your App. So if your customer using Window 8 the installer will install .NET 4.0 app version. If below Window 8 then install .NET 3.5 version.

LeDuc
  • 235
  • 2
  • 9