I have a .NET DLL that has the following inheritance structure (each object
inherits from the object above it):
BaseObject (VB6 COM DLL)
COM Interop DLL (.NET)
Abstract BaseObject (.NET)
Abstract BaseObject2 (.NET)
Concrete Object (.NET)
To complicate matters, the Concrete .NET Class needs to be accessible from
COM. I have set the appropriate attributes to make this happen, and
everything works fine on my machine, and some others too.
To register on another machine, I use RegAsm. However, on some XP machines,
regasm is failing, with the error:
RegAsm error: Could not load type XX.XX.AppBase from assembly XX.XX.XX,
Version=0.9.1616.28364, Culture=neutral, PublicKeyToken=null because the
format is invalid.
where XX.XX.AppBase is the first abstract base object. All machines are
running .NET 1.1. I have tried to work around the problem by using .reg
files to register the DLL, but that just defers the error message until the
application tries to use the object.
Has anyone any ideas on how I can resolve this, or what causes it?
Steven Campbell - 10 Jun 2004 16:13 GMT
I have found a solution for this. The problem turned out to be that my
.NET DLL exposed an ADO recordset. This was not a problem on machines with
Visual Studio.NET installed, because they have the primary interop assembly
for ADO (ADODB.DLL) in the GAC. However, most user machines do not. So the
solution was to copy ADODB.DLL from my local machine (C:\Program
Files\Microsoft.NET\Primary Interop Assemblies\ADODB.DLL) to the target
machine, and then install it to the GAC (gacutil -i ADODB.DLL).
~Steve
> I have a .NET DLL that has the following inheritance structure (each object
> inherits from the object above it):
[quoted text clipped - 22 lines]
>
> Has anyone any ideas on how I can resolve this, or what causes it?