How do I diagnose and fix .Net Framework and/or COM interop issues?

Posted on 2007-12-03
Medium Priority
Last Modified: 2013-11-26
I have created a .Net dll that I call from VB6.  This works on most computers.  Some customers get the following error:
Run-time error '429'  ActiveX component can't create object.

To try to debug this, I create a simple VB6 app and a simple VB6 dll and simple .Net dll and I think the problem is with the .Net framework.  I uninstalled and reinstalled the framework (2.0) and on some users' machines that worked.  On several others, it doesn't work.  

The simple test I created just has a VB6 form with a two command buttons.  The code in the command buttons instantiate the VB6 dll or the .Net dll object and calls a function that simply displays a message box.  I figured it doesn't get any easier than that.  

On the machines that fail, when I click on the button that uses the .Net object, I get the dreaded 'Run-time error '429'  ActiveX component can't create object' error message.  
I created a simple VB dotNet (VS2005) class library that I called SimpleTest.  On the compile tab of the property page, I have checked the Register for COM interop option.  Here is the code:
<ComClass()> _
Public Class InteropTest
    Public Function ShowDialog() As Boolean
        MsgBox("Hello from .Net 2.0!")
    End Function
End Class
I then create a simple VB6 ActiveX dll called SimpleVB6.  Here is the code:
Public Function ShowDialog() As Boolean
    MsgBox ("Hello from VB6!")
End Function
I then created a simple VB6 Standard EXE application and set references to both SimpleTest (the dotNet dll) and SimpleVB6 (VB6 dll).  I put two command buttons on the form and added the following code:
Private Sub Command1_Click()
    Dim st As SimpleTest.InteropTest
    Set st = New SimpleTest.InteropTest
End Sub
Private Sub Command2_Click()
    Dim st As SimpleVB6Test
    Set st = New SimpleVB6Test
End Sub

Open in new window

Question by:DalexSupport

Expert Comment

ID: 20400001
I would check out the security for managed code between the two machines.  The applet you are looking for is in control panel --> administrative tools --> .NET Framework 2.0 Configuration.  The place I would concentrate my energies in comparing would be under My Computer (within the applet)  and the section entitled Runtime Security Policy.

I hope this helps.  This is the only thing I can think of that would make your DLL work or not work and a reinstall of the framework fixes it on some computers.  This means there is Nothing wrong with your DLL and everything that could be wrong is in the configuration of the framework

Accepted Solution

DalexSupport earned 0 total points
ID: 20415847
.NET Framework 2.0 Configuration doesn't appear there.  

I have done some additional digging in one of my customer's computer and found that the 1.0 Framework seems to be the problem.  This computer is running the Tablet edition of Windows XP.  I found a tool at http://blogs.msdn.com/astebner/archive/2005/04/08/406671.aspx that is disigned to remove any .Net framework version. However, this tool would not remove the 1.0 framework because it said it was required by the Table Edition of the operating system (as well as the Media Center Edition).  

The only way I can get the the 2.0 framework to function is to uninstall all frameworks, reboot in safe mode and then delete the following files/folders:

Then reboot normally and install the 2.0 framework and my app and all is well.

Am I doing anything here that can prevent other apps from running?

Expert Comment

ID: 20555478
Closed, 500 points refunded.
Community Support Moderator

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question