COMException for DLL in C# but not in VB

43 Views Asked by At

I am trying to access a COM interface of an application from a C# project. I have an example that runs in VB. This means that the DLL should be registered etc.

If I try this in c# with:

using Library;
...
Fruit a = new Library.Fruit(); 

Then it throws an COMExeception 80040154 class not registered. However, things like:

using Library;
...
Car b = new Library.Car(); 

still work for some reason?! What could be the solution?

1

There are 1 best solutions below

0
On

The problem was an assignment issue, where I mixed up the correct syntax during the translation from VB to C#.