I don't know why / when this happens, but this error message bugs me like each year:
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
Additional information: The COM class factory for the component with the CLSID {C70F08F3-3F2A-477D-9F7A-B5463E973BDC} couldn't be access due to the following reason: 80040154 Class not registered (Exception of HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I don't remember how I solve it each time this occurs. I think I recompile the OCX component and then I add it again.
However, this would be strange because I can use the OCX component in VB6. Why should it not be accessibly in .NET then?
Can anybody explain what might be happening here?
Thank you.
Hard to guess without any supporting code in the OP, but the symptoms are consistent with the OCX having changed CLSID for whatever reason (for example, due to interface changes).
In that case:
rebuilding the OCX generally re-registers it at the end, so the right class is registered;
re-adding the reference to the OCX updates the referenced CLSID to the correct one.
As to why it works in VB6, most likely the reference has somehow been updated already. How exactly that happened is, again, hard to guess given the lack of details.