Author Topic: v15 & v16 - the dreaded "0x80040154 Class not registered" error  (Read 796 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Hi All,
Elsewhere I've mentioned that I have been forced to recreate an AddIn solution & project infrastructure (NOT Code) from scratch.  The solution consists of 10 separate projects which interact.
We have got it to the point where it builds and installs against .Net Framework 4.8 using VS 2022.  However, we cant get EA to attach to the AddIn.  When we start EA, we get the dreaded  "0x80040154 Class not registered" error in the Manage AddIns dialog.
 
To check if there was anything wrong with the development environment, we used Geert's excellent [size=78%]https://bellekens.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-add-in-in-10-minutes/[/size] and confirmed that "Alles ist in Ordnung"!

So my question is, we think we've followed all the instructions on how to set up and AddIn; we have an Installation project which seems to set up the registry correctly.  We confirmed this using the EAInstallationInspectorV6 utility from EXploringEA.  We have also tried various possible solutions from Dr Google to resolve the 0x80040154  error, to no avail!  Where should we look next to try and resolve the problem?

Interestingly, we have an older version of the AddIn, for which we no longer have the ability to create the solution.  If we copy the OLD dll files (from the older version) into the destination folder (in ProgramFiles (x86)), the old AddIn is recognised by EA and works perfectly!

Hopefully, some kind soul can help solve the mystery.  We've been at this for days, reaching the limit of our knowledge.

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11852
  • Karma: +460/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #1 on: June 30, 2022, 08:43:08 pm »
VS 2022 registers for 64 bit.
If you are using a 32 bit EA, you'll need to manually add the registration step. I do that by adding this in the build events as a post-build event:

Code: [Select]
"%windir%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" "$(TargetPath)" /codebase /tlb
Geert


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #2 on: June 30, 2022, 08:46:51 pm »
VS 2022 registers for 64 bit.
If you are using a 32-bit EA, you'll need to manually add the registration step. I do that by adding this in the build events as a post-build event:

Code: [Select]
"%windir%\Microsoft.NET\Framework\v4.0.30319\regasm.exe" "$(TargetPath)" /codebase /tlb
Geert
Thanks, Geert,
Sounds reasonable.  However, I didn't need to do that for your sample AddIn.  I just had to set the Platform Target to x86.  Can you comment on that?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11852
  • Karma: +460/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #3 on: June 30, 2022, 10:09:14 pm »
Not sure. I always compile in AnyCPU (for the DLL's anyway, a different story for the installer)
This makes sure my dll's are registered in both bitnesses (is that even a word?)

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #4 on: June 30, 2022, 11:32:18 pm »
Not sure. I always compile in AnyCPU (for the DLLs anyway, a different story for the Installer)
This makes sure my DLLs are registered in both bitnesses (is that even a word?)

Geert
I didn't end up building the Installer for your sample; I just registered the entry point and enabled "Register for COM Interop" (after targeting x86).

Also, is the build event code in the AddIn or the Installer?

Thanks, as always,

Paolo
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11852
  • Karma: +460/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #5 on: July 01, 2022, 01:55:27 am »
I didn't end up building the Installer for your sample; I just registered the entry point and enabled "Register for COM Interop" (after targeting x86).

Also, is the build event code in the AddIn or the Installer?

Thanks, as always,

Paolo
Paolo
in the add-in project

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #6 on: July 01, 2022, 10:50:13 am »
Hi Geert,
I added the post-build event but no observable difference.  I even registered the assembly manually (using the snippet), confirming registration succeeded.
Any idea where to look next?

Paolo


[Edit:  I looked at the build more carefully (I set the AddIn to start EA in Debug Mode) and observed the following:

'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Semantica\Diagramming Architect (SME)\Diagramming Architect (SME).dll'. Symbols loaded.
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Semantica\Diagramming Architect (SME)\SME_EA_Level0.dll'. Symbols loaded.
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Semantica\Diagramming Architect (SME)\Instrumentor.dll'. Symbols loaded.
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Semantica\Diagramming Architect (SME)\Global.dll'. Symbols loaded.
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.Resources.MissingManifestResourceException' in mscorlib.dll
'EA.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'D:\SoDoR\EA_AddIns\AddIns\TestAddin\bin\Debug\TestAddin.dll'. Symbols loaded.
Exception thrown: 'System.Resources.MissingManifestResourceException' in mscorlib.dll
The program '[56184] EA.exe' has exited with code 0 (0x0).


(Test Addin is my renamed version of your AddIn)
As you can see, it looks like it loaded 4 of the 11 project DLLs - but doesn't say which one failed (probably because of the missing manifest).  I'll have a look to see if any of my projects have an anomalous setting.]
[Edit2:  I had a look and couldn't see any anomalous settings, but then I've been looking at this so long I could easily have "snow blindness"  :( .]
[Edit3:  I thought the colours on the EAInstallationInspectorV6 were just to separate the lines, but they are meaning full.  EAInstallationInspectorV6 is saying that
Cyan - indicates that all the keys look fine but the DLL file does not exist at the specified location

As far as I can tell, the DLL file is at that location (see build above) and accessible to everyone.  Indeed, the inspector is obtaining the Assembly and File Versions from the file.  So what could be going on?]
« Last Edit: July 01, 2022, 03:35:46 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

EXploringEA

  • EA User
  • **
  • Posts: 171
  • Karma: +6/-0
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #7 on: July 09, 2022, 02:49:02 am »
Hi
Sorry I don't check out the forum much these days, but Ian alerted me so just read this thread and a couple of thoughts which I hope are helpful.

As I understand it:
* VS2022  - registered as compiled as x86 (not AnyCPU as Geert has said this will register as 64-bit) or manually using regasm
* 32-bit addin

From the latest log:

1. EA knows about yout AddIn hence the keys are correct and the DLL is registered.  You mentioned before that EA Installation Installer was Cyan - this can also indicate that the DLL has been registered without /codebase option however a bit confused as it seems to have loaded OK  - but you've got past that now.

2. However, looking at your latest information it looks to me like something (resources referenced by your code / project / DLL) is missing and hence when loading the DLL the core library throws an exception.  Worth checking the project for anything that may be referenced but is not present in the dll location ( specific - e.g. non-system - libraries) or embedded (icons, docs, ..)

BTW: I have just updated the Installation Inspector to V7 adding 64-bit support.  What colour does it show now - be interested to know if it differs?
This also meant I've had to change the way some information was obtained as well as tightened some of the checks, but still early days so sure I've missed something (let me know!).   Also the documentation now includes a list of registry locations which may be useful.

Adrian
EXploringEA - information, utilities and addins

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #8 on: July 09, 2022, 04:29:31 pm »
Hi Adrian,

I've got things working now.  I'm just trying to figure out what I had to change to get it working.  You are correct, there were issues caused by faulty resources.  The pointers people gave me and also some information from Sparx Support helped.

I'll download v7 and let you know.

Thanks,
PAolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #9 on: July 11, 2022, 07:20:53 pm »
Hi Adrian,

Comparing v6 and v7 provides differences in colouring.  Under V6, the entry is cyan, but in v7 it is green.  I am only working on a 32-bit add-in for now.

Paolo

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

EXploringEA

  • EA User
  • **
  • Posts: 171
  • Karma: +6/-0
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #10 on: July 12, 2022, 10:11:37 pm »
Paolo

Many thanks
Green is the colour that is expected if all working OK.  So looks fine.  In the rework to support 64-bit I think I've improved the checking that sets the colour.
Anybody find anything unusual/unexpected please let me know - email best - so I am made aware and I'll try to resolve.
EXploringEA - information, utilities and addins

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8198
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15 & v16 - the dreaded "0x80040154 Class not registered" error
« Reply #11 on: July 22, 2022, 01:13:32 pm »
Paolo

Many thanks
Green is the colour that is expected if all working OK.  So looks fine.  In the rework to support 64-bit I think I've improved the checking that sets the colour.
Anybody find anything unusual/unexpected please let me know - email best - so I am made aware and I'll try to resolve.
Hi Adrian,
(I'll also send an email)
I have a separate AddIn (that coincidentally uses much of the same lower-level projects).  EAII v7 says all green for both, EAII v6 says Cyan for both, but one (the original) loads OK in EA-32 v15.2
the new one is Errored in EA with "0x80040154 - Missing".  I haven't worked through the problem on my end, but I thought you should know about the anomaly.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!